Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCompilerToGPU.cpp @ 13648:27acedac70b7
added support for @ParallelOver annotation in PTX kernel call wrapper
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 15 Jan 2014 20:24:13 +0100 |
parents | 1dabd01a73bd |
children |
comparison
equal
deleted
inserted
replaced
13647:8edc6b0779f0 | 13648:27acedac70b7 |
---|---|
46 #define C2V_END } | 46 #define C2V_END } |
47 | 47 |
48 | 48 |
49 C2V_ENTRY(jlong, generateKernel, (JNIEnv *env, jobject, jbyteArray code, jstring name)) | 49 C2V_ENTRY(jlong, generateKernel, (JNIEnv *env, jobject, jbyteArray code, jstring name)) |
50 if (gpu::is_available() == false || gpu::has_gpu_linkage() == false && gpu::is_initialized()) { | 50 if (gpu::is_available() == false || gpu::has_gpu_linkage() == false && gpu::is_initialized()) { |
51 tty->print_cr("generateKernel - not available / no linkage / not initialized"); | 51 if (TraceGPUInteraction) { |
52 tty->print_cr("generateKernel - not available / no linkage / not initialized"); | |
53 } | |
52 return 0; | 54 return 0; |
53 } | 55 } |
54 jboolean is_copy; | 56 jboolean is_copy; |
55 jbyte *bytes = env->GetByteArrayElements(code, &is_copy); | 57 jbyte *bytes = env->GetByteArrayElements(code, &is_copy); |
56 jint len = env->GetArrayLength(code); | 58 jint len = env->GetArrayLength(code); |
57 const char *namestr = env->GetStringUTFChars(name, &is_copy); | 59 const char *namestr = env->GetStringUTFChars(name, &is_copy); |
58 void *kernel = gpu::generate_kernel((unsigned char *)bytes, len, namestr); | 60 void *kernel = gpu::generate_kernel((unsigned char *)bytes, len, namestr); |
59 if (kernel == NULL) { | 61 if (kernel == NULL) { |
60 tty->print_cr("[CUDA] *** Error: Failed to compile kernel"); | 62 tty->print_cr("[CUDA] *** Error: Failed to compile kernel"); |
61 } | 63 } else if (TraceGPUInteraction) { |
62 else if (TraceGPUInteraction) { | |
63 tty->print_cr("[CUDA] Generated kernel"); | 64 tty->print_cr("[CUDA] Generated kernel"); |
64 } | 65 } |
65 env->ReleaseByteArrayElements(code, bytes, 0); | 66 env->ReleaseByteArrayElements(code, bytes, 0); |
66 env->ReleaseStringUTFChars(name, namestr); | 67 env->ReleaseStringUTFChars(name, namestr); |
67 | 68 |