Mercurial > hg > truffle
annotate src/share/vm/graal/graalCompilerToGPU.cpp @ 12681:343477cb53ff
Merge
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Tue, 05 Nov 2013 19:02:14 +0100 |
parents | 1a7e7011a341 |
children | f1a55428a8d7 |
rev | line source |
---|---|
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
1 /* |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
4 * |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
8 * |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
14 * |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
18 * |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
21 * questions. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
22 */ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
23 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
24 #include "precompiled.hpp" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
25 |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
11902
diff
changeset
|
26 #include "memory/oopFactory.hpp" |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
27 #include "graal/graalCompiler.hpp" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
28 #include "graal/graalEnv.hpp" |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
29 #include "graal/graalJavaAccess.hpp" |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
30 #include "runtime/gpu.hpp" |
10685 | 31 #include "runtime/javaCalls.hpp" |
11596
91e5f927af63
Initial implementation of PTXRuntime (RegisterConfig, PTX description etc); guarded with new flag UseGPU. Specify -XX:+UseGPU to exercise this new implementation.
bharadwaj
parents:
11485
diff
changeset
|
32 # include "ptx/vm/ptxKernelArguments.hpp" |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
33 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
34 // Entry to native method implementation that transitions current thread to '_thread_in_vm'. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
35 #define C2V_VMENTRY(result_type, name, signature) \ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
36 JNIEXPORT result_type JNICALL c2v_ ## name signature { \ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
37 TRACE_graal_3("CompilerToGPU::" #name); \ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
38 GRAAL_VM_ENTRY_MARK; \ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
39 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
40 // Entry to native method implementation that calls a JNI function |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
41 // and hence cannot transition current thread to '_thread_in_vm'. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
42 #define C2V_ENTRY(result_type, name, signature) \ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
43 JNIEXPORT result_type JNICALL c2v_ ## name signature { \ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
44 TRACE_graal_3("CompilerToGPU::" #name); \ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
45 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
46 #define C2V_END } |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
47 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
48 |
10879
d55f24eac4b1
PTX support for Linux
Morris Meyer <morris.meyer@oracle.com>
parents:
10685
diff
changeset
|
49 C2V_ENTRY(jlong, generateKernel, (JNIEnv *env, jobject, jbyteArray code, jstring name)) |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
50 if (gpu::is_available() == false || gpu::has_gpu_linkage() == false && gpu::is_initialized()) { |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
51 tty->print_cr("generateKernel - not available / no linkage / not initialized"); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
52 return 0; |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
53 } |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
54 jboolean is_copy; |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
55 jbyte *bytes = env->GetByteArrayElements(code, &is_copy); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
56 jint len = env->GetArrayLength(code); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
57 const char *namestr = env->GetStringUTFChars(name, &is_copy); |
10563
7a3499bf5e2c
PTX kernel get_function return
Morris Meyer <morris.meyer@oracle.com>
parents:
9669
diff
changeset
|
58 void *kernel = gpu::generate_kernel((unsigned char *)bytes, len, namestr); |
10879
d55f24eac4b1
PTX support for Linux
Morris Meyer <morris.meyer@oracle.com>
parents:
10685
diff
changeset
|
59 if (kernel == NULL) { |
d55f24eac4b1
PTX support for Linux
Morris Meyer <morris.meyer@oracle.com>
parents:
10685
diff
changeset
|
60 tty->print_cr("[CUDA] *** Error: Failed to compile kernel"); |
d55f24eac4b1
PTX support for Linux
Morris Meyer <morris.meyer@oracle.com>
parents:
10685
diff
changeset
|
61 } |
d55f24eac4b1
PTX support for Linux
Morris Meyer <morris.meyer@oracle.com>
parents:
10685
diff
changeset
|
62 else if (TraceGPUInteraction) { |
d55f24eac4b1
PTX support for Linux
Morris Meyer <morris.meyer@oracle.com>
parents:
10685
diff
changeset
|
63 tty->print_cr("[CUDA] Generated kernel"); |
d55f24eac4b1
PTX support for Linux
Morris Meyer <morris.meyer@oracle.com>
parents:
10685
diff
changeset
|
64 } |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
65 env->ReleaseByteArrayElements(code, bytes, 0); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
66 env->ReleaseStringUTFChars(name, namestr); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
67 |
10563
7a3499bf5e2c
PTX kernel get_function return
Morris Meyer <morris.meyer@oracle.com>
parents:
9669
diff
changeset
|
68 return (jlong)kernel; |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
69 C2V_END |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
70 |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
71 C2V_VMENTRY(jobject, executeExternalMethodVarargs, (JNIEnv *env, jobject, jobject args, jobject hotspotInstalledCode)) |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
72 ResourceMark rm; |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
73 HandleMark hm; |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
74 |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
75 if (gpu::is_available() == false || gpu::has_gpu_linkage() == false && gpu::is_initialized()) { |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
76 tty->print_cr("executeExternalMethodVarargs - not available / no linkage / not initialized"); |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
77 return NULL; |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
78 } |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
79 jlong nmethodValue = HotSpotInstalledCode::codeBlob(hotspotInstalledCode); |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
80 nmethod* nm = (nmethod*) (address) nmethodValue; |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
81 methodHandle mh = nm->method(); |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
82 Symbol* signature = mh->signature(); |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
83 |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
84 // start value is the kernel |
11381
001c41b01d13
HotSpotInstalledCode: moved getCode to Java and added the ability to get the whole blob
twisti
parents:
11291
diff
changeset
|
85 jlong startValue = HotSpotInstalledCode::codeStart(hotspotInstalledCode); |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
86 |
11485
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11381
diff
changeset
|
87 PTXKernelArguments ptxka(signature, (arrayOop) JNIHandles::resolve(args), mh->is_static()); |
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11381
diff
changeset
|
88 JavaValue result(ptxka.get_ret_type()); |
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11381
diff
changeset
|
89 if (!gpu::execute_kernel((address)startValue, ptxka, result)) { |
11283
1cd1f8ff70a1
CR-20: PTX kernel invocation with arguments - from Bharadwaj
Morris Meyer <morris.meyer@oracle.com>
parents:
10879
diff
changeset
|
90 return NULL; |
1cd1f8ff70a1
CR-20: PTX kernel invocation with arguments - from Bharadwaj
Morris Meyer <morris.meyer@oracle.com>
parents:
10879
diff
changeset
|
91 } |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
92 |
11485
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11381
diff
changeset
|
93 if (ptxka.get_ret_type() == T_VOID) { |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
94 return NULL; |
11485
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11381
diff
changeset
|
95 } else if (ptxka.get_ret_type() == T_OBJECT || ptxka.get_ret_type() == T_ARRAY) { |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
96 return JNIHandles::make_local((oop) result.get_jobject()); |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
97 } else { |
11485
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11381
diff
changeset
|
98 oop o = java_lang_boxing_object::create(ptxka.get_ret_type(), (jvalue *) result.get_value_addr(), CHECK_NULL); |
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11381
diff
changeset
|
99 if (TraceGPUInteraction) { |
11902
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
100 switch (ptxka.get_ret_type()) { |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
101 case T_INT: |
12653
1a7e7011a341
* PTX kernel argument buffer now has naturally aligned arguments as required by PTX JIT compiler.
S.Bharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
parents:
12490
diff
changeset
|
102 tty->print_cr("GPU execution returned (int) %d", result.get_jint()); |
1a7e7011a341
* PTX kernel argument buffer now has naturally aligned arguments as required by PTX JIT compiler.
S.Bharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
parents:
12490
diff
changeset
|
103 break; |
1a7e7011a341
* PTX kernel argument buffer now has naturally aligned arguments as required by PTX JIT compiler.
S.Bharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
parents:
12490
diff
changeset
|
104 case T_LONG: |
1a7e7011a341
* PTX kernel argument buffer now has naturally aligned arguments as required by PTX JIT compiler.
S.Bharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
parents:
12490
diff
changeset
|
105 tty->print_cr("GPU execution returned (long) %ld", result.get_jlong()); |
11902
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
106 break; |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
107 case T_FLOAT: |
12653
1a7e7011a341
* PTX kernel argument buffer now has naturally aligned arguments as required by PTX JIT compiler.
S.Bharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
parents:
12490
diff
changeset
|
108 tty->print_cr("GPU execution returned (float) %f", result.get_jfloat()); |
11902
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
109 break; |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
110 case T_DOUBLE: |
12653
1a7e7011a341
* PTX kernel argument buffer now has naturally aligned arguments as required by PTX JIT compiler.
S.Bharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
parents:
12490
diff
changeset
|
111 tty->print_cr("GPU execution returned (double) %f", result.get_jdouble()); |
11902
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
112 break; |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
113 default: |
12653
1a7e7011a341
* PTX kernel argument buffer now has naturally aligned arguments as required by PTX JIT compiler.
S.Bharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
parents:
12490
diff
changeset
|
114 tty->print_cr("**** Value returned by GPU not yet handled"); |
11902
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
115 break; |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
116 } |
11485
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11381
diff
changeset
|
117 } |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
118 return JNIHandles::make_local(o); |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
119 } |
11485
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11381
diff
changeset
|
120 |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
121 C2V_END |
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10563
diff
changeset
|
122 |
11822
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
123 C2V_VMENTRY(jobject, executeParallelMethodVarargs, (JNIEnv *env, |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
124 jobject, |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
125 jint dimX, jint dimY, jint dimZ, |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
126 jobject args, jobject hotspotInstalledCode)) |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
127 ResourceMark rm; |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
128 HandleMark hm; |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
129 |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
130 if (gpu::is_available() == false || gpu::has_gpu_linkage() == false && gpu::is_initialized()) { |
11842
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
131 tty->print_cr("executeParallelMethodVarargs - not available / no linkage / not initialized"); |
11822
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
132 return NULL; |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
133 } |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
134 jlong nmethodValue = HotSpotInstalledCode::codeBlob(hotspotInstalledCode); |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
135 nmethod* nm = (nmethod*) (address) nmethodValue; |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
136 methodHandle mh = nm->method(); |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
137 Symbol* signature = mh->signature(); |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
138 |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
139 // start value is the kernel |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
140 jlong startValue = HotSpotInstalledCode::codeStart(hotspotInstalledCode); |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
141 |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
142 PTXKernelArguments ptxka(signature, (arrayOop) JNIHandles::resolve(args), mh->is_static()); |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
143 JavaValue result(ptxka.get_ret_type()); |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
144 if (!gpu::execute_warp(dimX, dimY, dimZ, (address)startValue, ptxka, result)) { |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
145 return NULL; |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
146 } |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
147 |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
148 if (ptxka.get_ret_type() == T_VOID) { |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
149 return NULL; |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
150 } else if (ptxka.get_ret_type() == T_OBJECT || ptxka.get_ret_type() == T_ARRAY) { |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
151 return JNIHandles::make_local((oop) result.get_jobject()); |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
152 } else { |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
153 oop o = java_lang_boxing_object::create(ptxka.get_ret_type(), (jvalue *) result.get_value_addr(), CHECK_NULL); |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
154 if (TraceGPUInteraction) { |
11902
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
155 switch (ptxka.get_ret_type()) { |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
156 case T_INT: |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
157 tty->print_cr("GPU execution returned %d", result.get_jint()); |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
158 break; |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
159 case T_FLOAT: |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
160 tty->print_cr("GPU execution returned %f", result.get_jfloat()); |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
161 break; |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
162 case T_DOUBLE: |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
163 tty->print_cr("GPU execution returned %g", result.get_jdouble()); |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
164 break; |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
165 default: |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
166 tty->print_cr("GPU returned unhandled"); |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
167 break; |
67a1e27a8dbb
PTX initial float and double
Morris Meyer <morris.meyer@oracle.com>
parents:
11842
diff
changeset
|
168 } |
11822
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
169 } |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
170 return JNIHandles::make_local(o); |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
171 } |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
172 |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
173 C2V_END |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
174 |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
175 C2V_VMENTRY(jboolean, deviceInit, (JNIEnv *env, jobject)) |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
176 if (gpu::is_available() == false || gpu::has_gpu_linkage() == false) { |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
177 tty->print_cr("deviceInit - not available / no linkage"); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
178 return false; |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
179 } |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
180 if (gpu::is_initialized()) { |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
181 tty->print_cr("deviceInit - already initialized"); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
182 return true; |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
183 } |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
184 gpu::initialize_gpu(); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
185 return gpu::is_initialized(); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
186 C2V_END |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
187 |
11842
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
188 C2V_VMENTRY(jint, availableProcessors, (JNIEnv *env, jobject)) |
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
189 if (gpu::is_available() == false || gpu::has_gpu_linkage() == false) { |
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
190 tty->print_cr("deviceInit - not available / no linkage"); |
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
191 return false; |
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
192 } |
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
193 return gpu::available_processors(); |
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
194 C2V_END |
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
195 |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
196 C2V_VMENTRY(jboolean, deviceDetach, (JNIEnv *env, jobject)) |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
197 return true; |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
198 C2V_END |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
199 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
200 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
201 #define CC (char*) /*cast a literal from (const char*)*/ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
202 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f)) |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
203 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
204 #define RESOLVED_TYPE "Lcom/oracle/graal/api/meta/ResolvedJavaType;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
205 #define TYPE "Lcom/oracle/graal/api/meta/JavaType;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
206 #define METHOD "Lcom/oracle/graal/api/meta/JavaMethod;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
207 #define FIELD "Lcom/oracle/graal/api/meta/JavaField;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
208 #define SIGNATURE "Lcom/oracle/graal/api/meta/Signature;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
209 #define CONSTANT_POOL "Lcom/oracle/graal/api/meta/ConstantPool;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
210 #define CONSTANT "Lcom/oracle/graal/api/meta/Constant;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
211 #define KIND "Lcom/oracle/graal/api/meta/Kind;" |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
11902
diff
changeset
|
212 #define LOCAL "Lcom/oracle/graal/api/meta/Local;" |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
213 #define RUNTIME_CALL "Lcom/oracle/graal/api/code/RuntimeCall;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
214 #define EXCEPTION_HANDLERS "[Lcom/oracle/graal/api/meta/ExceptionHandler;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
215 #define REFLECT_METHOD "Ljava/lang/reflect/Method;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
216 #define REFLECT_CONSTRUCTOR "Ljava/lang/reflect/Constructor;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
217 #define REFLECT_FIELD "Ljava/lang/reflect/Field;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
218 #define STRING "Ljava/lang/String;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
219 #define OBJECT "Ljava/lang/Object;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
220 #define CLASS "Ljava/lang/Class;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
221 #define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
222 #define HS_RESOLVED_TYPE "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedObjectType;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
223 #define HS_RESOLVED_JAVA_TYPE "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaType;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
224 #define HS_RESOLVED_METHOD "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
225 #define HS_RESOLVED_FIELD "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaField;" |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9430
diff
changeset
|
226 #define HS_COMPILED_CODE "Lcom/oracle/graal/hotspot/HotSpotCompiledCode;" |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
227 #define HS_CONFIG "Lcom/oracle/graal/hotspot/HotSpotVMConfig;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
228 #define HS_METHOD "Lcom/oracle/graal/hotspot/meta/HotSpotMethod;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
229 #define HS_INSTALLED_CODE "Lcom/oracle/graal/hotspot/meta/HotSpotInstalledCode;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
230 #define METHOD_DATA "Lcom/oracle/graal/hotspot/meta/HotSpotMethodData;" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
231 #define METASPACE_METHOD "J" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
232 #define METASPACE_METHOD_DATA "J" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
233 #define NMETHOD "J" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
234 #define GPUSPACE_METHOD "J" |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
235 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
236 JNINativeMethod CompilerToGPU_methods[] = { |
11822
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
237 {CC"generateKernel", CC"([B" STRING ")"GPUSPACE_METHOD, FN_PTR(generateKernel)}, |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
238 {CC"deviceInit", CC"()Z", FN_PTR(deviceInit)}, |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
239 {CC"deviceDetach", CC"()Z", FN_PTR(deviceDetach)}, |
11842
8d8f63069f58
PTX warp limiter to available GPU processors
Morris Meyer <morris.meyer@oracle.com>
parents:
11822
diff
changeset
|
240 {CC"availableProcessors", CC"()I", FN_PTR(availableProcessors)}, |
11822
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
241 {CC"executeExternalMethodVarargs", CC"(["OBJECT HS_INSTALLED_CODE")"OBJECT, FN_PTR(executeExternalMethodVarargs)}, |
365d8f385fb5
PTX: one-dimensional parallel warp invocation, ParallelOver annotation
Morris Meyer <morris.meyer@oracle.com>
parents:
11596
diff
changeset
|
242 {CC"executeParallelMethodVarargs", CC"(III["OBJECT HS_INSTALLED_CODE")"OBJECT, FN_PTR(executeParallelMethodVarargs)}, |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
243 }; |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
244 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
245 int CompilerToGPU_methods_count() { |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
246 return sizeof(CompilerToGPU_methods) / sizeof(JNINativeMethod); |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
247 } |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
248 |