Mercurial > hg > graal-jvmci-8
comparison src/gpu/ptx/vm/ptxKernelArguments.cpp @ 11902:67a1e27a8dbb
PTX initial float and double
author | Morris Meyer <morris.meyer@oracle.com> |
---|---|
date | Sun, 06 Oct 2013 22:07:23 -0400 |
parents | 61767ccd4600 |
children | cfba4fd3d616 |
comparison
equal
deleted
inserted
replaced
11901:61767ccd4600 | 11902:67a1e27a8dbb |
---|---|
98 _success = false; | 98 _success = false; |
99 return; | 99 return; |
100 } | 100 } |
101 *((gpu::Ptx::CUdeviceptr*) &_kernelArgBuffer[_bufferOffset]) = floatval.f; | 101 *((gpu::Ptx::CUdeviceptr*) &_kernelArgBuffer[_bufferOffset]) = floatval.f; |
102 _bufferOffset += sizeof(floatval.f); | 102 _bufferOffset += sizeof(floatval.f); |
103 } | |
104 return; | |
105 } | |
106 | |
107 void PTXKernelArguments::do_double() { | |
108 if (is_after_invocation()) { | |
109 return; | |
110 } | |
111 // If the parameter is a return value, | |
112 jvalue doubleval; | |
113 if (is_return_type()) { | |
114 // Allocate device memory for T_INT return value pointer on device. Size in bytes | |
115 int status = gpu::Ptx::_cuda_cu_memalloc(&_return_value_ptr, T_DOUBLE_BYTE_SIZE); | |
116 if (status != GRAAL_CUDA_SUCCESS) { | |
117 tty->print_cr("[CUDA] *** Error (%d) Failed to allocate memory for return value pointer on device", status); | |
118 _success = false; | |
119 return; | |
120 } | |
121 // Push _return_value_ptr to _kernelBuffer | |
122 *((gpu::Ptx::CUdeviceptr*) &_kernelArgBuffer[_bufferOffset]) = _return_value_ptr; | |
123 // _bufferOffset += sizeof(_return_value_ptr); | |
124 _bufferOffset += sizeof(doubleval.d); | |
125 } else { | |
126 // Get the next java argument and its value which should be a T_INT | |
127 oop arg = next_arg(T_FLOAT); | |
128 // Copy the java argument value to kernelArgBuffer | |
129 if (java_lang_boxing_object::get_value(arg, &doubleval) != T_DOUBLE) { | |
130 tty->print_cr("[CUDA] *** Error: Unexpected argument type; expecting T_INT"); | |
131 _success = false; | |
132 return; | |
133 } | |
134 *((gpu::Ptx::CUdeviceptr*) &_kernelArgBuffer[_bufferOffset]) = doubleval.d; | |
135 _bufferOffset += sizeof(doubleval.d); | |
103 } | 136 } |
104 return; | 137 return; |
105 } | 138 } |
106 | 139 |
107 void PTXKernelArguments::do_long() { | 140 void PTXKernelArguments::do_long() { |