comparison src/gpu/ptx/vm/ptxKernelArguments.cpp @ 11901:61767ccd4600

PTX boolean return value, emitIntegerTestMove, warnings
author Morris Meyer <morris.meyer@oracle.com>
date Sun, 06 Oct 2013 18:15:56 -0400
parents c7abc8411011
children 67a1e27a8dbb
comparison
equal deleted inserted replaced
11900:1f82cda83ced 11901:61767ccd4600
166 _bufferOffset += sizeof(val.b); 166 _bufferOffset += sizeof(val.b);
167 } 167 }
168 return; 168 return;
169 } 169 }
170 170
171 void PTXKernelArguments::do_bool() {
172 if (is_after_invocation()) {
173 return;
174 }
175 // If the parameter is a return value,
176 if (is_return_type()) {
177 // Allocate device memory for T_BYTE return value pointer on device. Size in bytes
178 int status = gpu::Ptx::_cuda_cu_memalloc(&_return_value_ptr, T_BOOLEAN_SIZE);
179 if (status != GRAAL_CUDA_SUCCESS) {
180 tty->print_cr("[CUDA] *** Error (%d) Failed to allocate memory for return value pointer on device", status);
181 _success = false;
182 return;
183 }
184 // Push _return_value_ptr to _kernelBuffer
185 *((gpu::Ptx::CUdeviceptr*) &_kernelArgBuffer[_bufferOffset]) = _return_value_ptr;
186 _bufferOffset += sizeof(_return_value_ptr);
187 } else {
188 // Get the next java argument and its value which should be a T_BYTE
189 oop arg = next_arg(T_BYTE);
190 // Copy the java argument value to kernelArgBuffer
191 jvalue val;
192 if (java_lang_boxing_object::get_value(arg, &val) != T_BOOLEAN) {
193 tty->print_cr("[CUDA] *** Error: Unexpected argument type; expecting T_BYTE");
194 _success = false;
195 return;
196 }
197 *((gpu::Ptx::CUdeviceptr*) &_kernelArgBuffer[_bufferOffset]) = val.z;
198 _bufferOffset += sizeof(val.z);
199 }
200 return;
201 }
202
171 void PTXKernelArguments::do_array(int begin, int end) { 203 void PTXKernelArguments::do_array(int begin, int end) {
172 gpu::Ptx::CUdeviceptr _array_ptr; 204 gpu::Ptx::CUdeviceptr _array_ptr;
173 int status; 205 int status;
174 206
175 // Get the next java argument and its value which should be a T_ARRAY 207 // Get the next java argument and its value which should be a T_ARRAY