Mercurial > hg > graal-jvmci-8
comparison src/gpu/hsail/vm/gpu_hsail.cpp @ 18855:82e5b5ccdb0c
fix format string
Contributed-by: Igor Ignatyev <igor.ignatyev@oracle.com>
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 13 Jan 2015 13:04:37 +0100 |
parents | f55f2d400797 |
children |
comparison
equal
deleted
inserted
replaced
18854:b8d3f84740c7 | 18855:82e5b5ccdb0c |
---|---|
145 assert(THREAD->is_Java_thread(), "must be a JavaThread"); | 145 assert(THREAD->is_Java_thread(), "must be a JavaThread"); |
146 | 146 |
147 // We avoid HSAILAllocationInfo logic if kernel does not allocate | 147 // We avoid HSAILAllocationInfo logic if kernel does not allocate |
148 // in which case the num_tlabs passed in will be 0 | 148 // in which case the num_tlabs passed in will be 0 |
149 HSAILAllocationInfo* allocInfo = (num_tlabs == 0 ? NULL : new HSAILAllocationInfo(num_tlabs, dimX, allocBytesPerWorkitem)); | 149 HSAILAllocationInfo* allocInfo = (num_tlabs == 0 ? NULL : new HSAILAllocationInfo(num_tlabs, dimX, allocBytesPerWorkitem)); |
150 | 150 |
151 // Reset the kernel arguments | 151 // Reset the kernel arguments |
152 _okra_clear_args(kernel); | 152 _okra_clear_args(kernel); |
153 | 153 |
154 JavaThread* thread = (JavaThread*)THREAD; | 154 JavaThread* thread = (JavaThread*)THREAD; |
155 HSAILDeoptimizationInfo* e; | 155 HSAILDeoptimizationInfo* e; |
258 int pc_offset = hsailFrame->pc_offset(); | 258 int pc_offset = hsailFrame->pc_offset(); |
259 for (int bit = 0; bit < maxOopBits; bit++) { | 259 for (int bit = 0; bit < maxOopBits; bit++) { |
260 if (oopMapHelper.is_oop(pc_offset, bit)) { | 260 if (oopMapHelper.is_oop(pc_offset, bit)) { |
261 if (bit < hsailFrame->num_d_regs()) { | 261 if (bit < hsailFrame->num_d_regs()) { |
262 // show $d reg oop | 262 // show $d reg oop |
263 tty->print_cr(" oop $d%d = " INTPTR_FORMAT, bit, hsailFrame->get_oop_for_bit(bit)); | 263 tty->print_cr(" oop $d%d = " PTR64_FORMAT, bit, hsailFrame->get_oop_for_bit(bit)); |
264 } else { | 264 } else { |
265 // show stack slot oop | 265 // show stack slot oop |
266 int stackOffset = (bit - hsailFrame->num_d_regs()) * 8; // 8 bytes per stack slot | 266 int stackOffset = (bit - hsailFrame->num_d_regs()) * 8; // 8 bytes per stack slot |
267 tty->print_cr(" oop stk:%d = " INTPTR_FORMAT, stackOffset, hsailFrame->get_oop_for_bit(bit)); | 267 tty->print_cr(" oop stk:%d = " PTR64_FORMAT, stackOffset, hsailFrame->get_oop_for_bit(bit)); |
268 } | 268 } |
269 } | 269 } |
270 } | 270 } |
271 } | 271 } |
272 JavaCalls::call(&result, mh, &javaArgs, THREAD); | 272 JavaCalls::call(&result, mh, &javaArgs, THREAD); |
279 } | 279 } |
280 } | 280 } |
281 } | 281 } |
282 // when we are done with the deopts, we don't need to oops_do anything | 282 // when we are done with the deopts, we don't need to oops_do anything |
283 // in the saved state anymore | 283 // in the saved state anymore |
284 thread->set_gpu_hsail_deopt_info(NULL); | 284 thread->set_gpu_hsail_deopt_info(NULL); |
285 | 285 |
286 // Handle any never_ran workitems if there were any | 286 // Handle any never_ran workitems if there were any |
287 { | 287 { |
288 TraceTime t("handle never-rans ", TraceGPUInteraction); | 288 TraceTime t("handle never-rans ", TraceGPUInteraction); |
289 int count_never_ran = 0; | 289 int count_never_ran = 0; |
343 name[name_len] = 0; | 343 name[name_len] = 0; |
344 | 344 |
345 env->GetByteArrayRegion(code_handle, 0, code_len, (jbyte*) code); | 345 env->GetByteArrayRegion(code_handle, 0, code_len, (jbyte*) code); |
346 env->GetStringUTFRegion(name_handle, 0, name_len, name); | 346 env->GetStringUTFRegion(name_handle, 0, name_len, name); |
347 | 347 |
348 // The kernel entrypoint is always run for the time being | 348 // The kernel entrypoint is always run for the time being |
349 const char* entryPointName = "&run"; | 349 const char* entryPointName = "&run"; |
350 jlong okra_kernel; | 350 jlong okra_kernel; |
351 { | 351 { |
352 TraceTime t("generate kernel ", TraceGPUInteraction); | 352 TraceTime t("generate kernel ", TraceGPUInteraction); |
353 jint okra_status = _okra_create_kernel(_device_context, code, entryPointName, (void**)&okra_kernel); | 353 jint okra_status = _okra_create_kernel(_device_context, code, entryPointName, (void**)&okra_kernel); |
398 okra_lib_handle = ::dlopen(okra_library_name, RTLD_LAZY | RTLD_NOLOAD); | 398 okra_lib_handle = ::dlopen(okra_library_name, RTLD_LAZY | RTLD_NOLOAD); |
399 #endif | 399 #endif |
400 // If Okra library is not already loaded, load it here | 400 // If Okra library is not already loaded, load it here |
401 if (okra_lib_handle == NULL) { | 401 if (okra_lib_handle == NULL) { |
402 okra_lib_handle = os::dll_load(okra_library_name, ebuf, O_BUFLEN); | 402 okra_lib_handle = os::dll_load(okra_library_name, ebuf, O_BUFLEN); |
403 } | 403 } |
404 if (okra_lib_handle == NULL) { | 404 if (okra_lib_handle == NULL) { |
405 // Unable to open Okra library | 405 // Unable to open Okra library |
406 if (TraceGPUInteraction) { | 406 if (TraceGPUInteraction) { |
407 tty->print_cr("[HSAIL] library load failed."); | 407 tty->print_cr("[HSAIL] library load failed."); |
408 } | 408 } |
409 return false; | 409 return false; |
410 } | 410 } |
411 | 411 |
412 guarantee(_okra_get_context == NULL, "cannot repeat GPU initialization"); | 412 guarantee(_okra_get_context == NULL, "cannot repeat GPU initialization"); |
413 | 413 |
414 // At this point we know okra_lib_handle is valid whether we loaded | 414 // At this point we know okra_lib_handle is valid whether we loaded |
415 // here or earlier. In either case, we can lookup the functions. | 415 // here or earlier. In either case, we can lookup the functions. |
416 LOOKUP_OKRA_FUNCTION(okra_get_context, okra_get_context); | 416 LOOKUP_OKRA_FUNCTION(okra_get_context, okra_get_context); |