annotate src/gpu/hsail/vm/gpu_hsail.cpp @ 13826:62bd4705894c

reverted removal of Okra Windows DLL name
author Doug Simon <doug.simon@oracle.com>
date Thu, 30 Jan 2014 17:27:04 +0100
parents 35fc64972250
children 51584f76462d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 *
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 */
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 #include "precompiled.hpp"
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26 #include "runtime/javaCalls.hpp"
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27 #include "runtime/gpu.hpp"
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28 #include "utilities/globalDefinitions.hpp"
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
29 #include "utilities/ostream.hpp"
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 #include "memory/allocation.hpp"
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 #include "memory/allocation.inline.hpp"
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
32 #include "graal/graalEnv.hpp"
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
33 #include "graal/graalCompiler.hpp"
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
34 #include "graal/graalJavaAccess.hpp"
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 #include "hsailKernelArguments.hpp"
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
37 // Entry to GPU native method implementation that transitions current thread to '_thread_in_vm'.
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
38 #define GPU_VMENTRY(result_type, name, signature) \
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
39 JNIEXPORT result_type JNICALL name signature { \
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
40 GRAAL_VM_ENTRY_MARK; \
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
41
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
42 // Entry to GPU native method implementation that calls a JNI function
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
43 // and hence cannot transition current thread to '_thread_in_vm'.
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
44 #define GPU_ENTRY(result_type, name, signature) \
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
45 JNIEXPORT result_type JNICALL name signature { \
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
46
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
47 #define GPU_END }
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
48
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
49 #define CC (char*) /*cast a literal from (const char*)*/
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
50 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(f))
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
51
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
52 #define OBJECT "Ljava/lang/Object;"
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
53 #define STRING "Ljava/lang/String;"
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
54 #define HS_INSTALLED_CODE "Lcom/oracle/graal/hotspot/meta/HotSpotInstalledCode;"
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
55
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
56 // public native void executeKernel(HotSpotNmethod kernel, int jobSize, int i, int j, Object[] args) throws InvalidInstalledCodeException;
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
57
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
58 JNINativeMethod gpu::Hsail::HSAIL_methods[] = {
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
59 {CC"initialize", CC"()Z", FN_PTR(gpu::Hsail::initialize)},
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
60 {CC"generateKernel", CC"([B" STRING ")J", FN_PTR(gpu::Hsail::generate_kernel)},
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
61 {CC"executeKernel0", CC"("HS_INSTALLED_CODE"I["OBJECT")Z", FN_PTR(gpu::Hsail::execute_kernel_void_1d)},
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
62 };
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
63
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
64 void * gpu::Hsail::_device_context = NULL;
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65
13115
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
66 gpu::Hsail::okra_create_context_func_t gpu::Hsail::_okra_create_context;
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
67 gpu::Hsail::okra_create_kernel_func_t gpu::Hsail::_okra_create_kernel;
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
68 gpu::Hsail::okra_push_object_func_t gpu::Hsail::_okra_push_object;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
69 gpu::Hsail::okra_push_boolean_func_t gpu::Hsail::_okra_push_boolean;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
70 gpu::Hsail::okra_push_byte_func_t gpu::Hsail::_okra_push_byte;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
71 gpu::Hsail::okra_push_double_func_t gpu::Hsail::_okra_push_double;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
72 gpu::Hsail::okra_push_float_func_t gpu::Hsail::_okra_push_float;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
73 gpu::Hsail::okra_push_int_func_t gpu::Hsail::_okra_push_int;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
74 gpu::Hsail::okra_push_long_func_t gpu::Hsail::_okra_push_long;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
75 gpu::Hsail::okra_execute_with_range_func_t gpu::Hsail::_okra_execute_with_range;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
76 gpu::Hsail::okra_clearargs_func_t gpu::Hsail::_okra_clearargs;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
77 gpu::Hsail::okra_register_heap_func_t gpu::Hsail::_okra_register_heap;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
78
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
79
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
80 void gpu::Hsail::register_heap() {
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
81 // After the okra functions are set up and the heap is initialized, register the java heap with HSA
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
82 guarantee(Universe::heap() != NULL, "heap should be there by now.");
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
83 if (TraceGPUInteraction) {
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
84 tty->print_cr("[HSAIL] heap=" PTR_FORMAT, Universe::heap());
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
85 tty->print_cr("[HSAIL] base=0x%08x, capacity=%ld", Universe::heap()->base(), Universe::heap()->capacity());
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
86 }
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
87 _okra_register_heap(Universe::heap()->base(), Universe::heap()->capacity());
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
88 }
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
89
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
90 GPU_VMENTRY(jboolean, gpu::Hsail::execute_kernel_void_1d, (JNIEnv* env, jclass, jobject kernel_handle, jint dimX, jobject args_handle))
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
91
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
92 ResourceMark rm;
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
93 jlong nmethodValue = HotSpotInstalledCode::codeBlob(kernel_handle);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
94 if (nmethodValue == 0) {
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
95 SharedRuntime::throw_and_post_jvmti_exception(JavaThread::current(), vmSymbols::com_oracle_graal_api_code_InvalidInstalledCodeException(), NULL);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
96 }
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
97 nmethod* nm = (nmethod*) (address) nmethodValue;
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
98 methodHandle mh = nm->method();
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
99 Symbol* signature = mh->signature();
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
100
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
101 void* kernel = (void*) HotSpotInstalledCode::codeStart(kernel_handle);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
102 if (kernel == NULL) {
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
103 SharedRuntime::throw_and_post_jvmti_exception(JavaThread::current(), vmSymbols::com_oracle_graal_api_code_InvalidInstalledCodeException(), NULL);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
104 }
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
105
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
106 objArrayOop args = (objArrayOop) JNIHandles::resolve(args_handle);
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
107
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
108 // Reset the kernel arguments
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
109 _okra_clearargs(kernel);
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
110
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
111 // This object sets up the kernel arguments
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
112 HSAILKernelArguments hka((address) kernel, mh->signature(), args, mh->is_static());
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
113
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
114 // Run the kernel
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
115 return _okra_execute_with_range(kernel, dimX);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
116 GPU_END
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
117
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
118 GPU_ENTRY(jlong, gpu::Hsail::generate_kernel, (JNIEnv *env, jclass, jbyteArray code_handle, jstring name_handle))
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
119 guarantee(_okra_create_kernel != NULL, "[HSAIL] Okra not linked");
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
120 ResourceMark rm;
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
121 jsize name_len = env->GetStringLength(name_handle);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
122 jsize code_len = env->GetArrayLength(code_handle);
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
123
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
124 char* name = NEW_RESOURCE_ARRAY(char, name_len + 1);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
125 unsigned char *code = NEW_RESOURCE_ARRAY(unsigned char, code_len + 1);
13740
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
126
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
127 code[code_len] = 0;
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
128 name[name_len] = 0;
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
129
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
130 env->GetByteArrayRegion(code_handle, 0, code_len, (jbyte*) code);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
131 env->GetStringUTFRegion(name_handle, 0, name_len, name);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
132
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
133 register_heap();
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
134
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
135 // The kernel entrypoint is always run for the time being
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
136 const char* entryPointName = "&run";
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
137
13115
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
138 _device_context = _okra_create_context();
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
139
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
140 return (jlong) _okra_create_kernel(_device_context, code, entryPointName);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
141 GPU_END
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
142
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
143 #if defined(LINUX)
13822
35fc64972250 fixed Linux compile error and removed name of not-yet-existing Windows Okra dll
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
144 static const char* okra_library_name = "libokra_x86_64.so";
13826
62bd4705894c reverted removal of Okra Windows DLL name
Doug Simon <doug.simon@oracle.com>
parents: 13822
diff changeset
145 #elif defined(_WINDOWS)
62bd4705894c reverted removal of Okra Windows DLL name
Doug Simon <doug.simon@oracle.com>
parents: 13822
diff changeset
146 static char const* okra_library_name = "okra_x86_64.dll";
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
147 #else
13822
35fc64972250 fixed Linux compile error and removed name of not-yet-existing Windows Okra dll
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
148 static char const* okra_library_name = NULL;
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
149 #endif
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
150
13115
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
151 #define STRINGIFY(x) #x
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
152
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
153 #define LOOKUP_OKRA_FUNCTION(name, alias) \
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
154 _##alias = \
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
155 CAST_TO_FN_PTR(alias##_func_t, os::dll_lookup(handle, STRINGIFY(name))); \
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
156 if (_##alias == NULL) { \
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
157 tty->print_cr("[HSAIL] ***** Error: Failed to lookup %s in %s, wrong version of OKRA?", STRINGIFY(name), okra_library_name); \
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
158 return false; \
13115
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
159 } \
166ed1584f30 HSAIL: null checks when loading Okra library functions
Doug Simon <doug.simon@oracle.com>
parents: 13097
diff changeset
160
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
161 GPU_ENTRY(jboolean, gpu::Hsail::initialize, (JNIEnv *env, jclass))
13740
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
162 if (okra_library_name == NULL) {
13097
14db5ffd5ed9 make HSAIL silent
twisti
parents: 12743
diff changeset
163 if (TraceGPUInteraction) {
14db5ffd5ed9 make HSAIL silent
twisti
parents: 12743
diff changeset
164 tty->print_cr("Unsupported HSAIL platform");
14db5ffd5ed9 make HSAIL silent
twisti
parents: 12743
diff changeset
165 }
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
166 return false;
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
167 }
13740
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
168
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
169 // here we know we have a valid okra_library_name to try to load
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
170 char ebuf[O_BUFLEN];
13097
14db5ffd5ed9 make HSAIL silent
twisti
parents: 12743
diff changeset
171 if (TraceGPUInteraction) {
13740
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
172 tty->print_cr("[HSAIL] library is %s", okra_library_name);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
173 }
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
174 void *handle = os::dll_load(okra_library_name, ebuf, O_BUFLEN);
13740
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
175 // try alternate location if env variable set
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
176 char *okra_lib_name_from_env_var = getenv("_OKRA_SIM_LIB_PATH_");
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
177 if ((handle == NULL) && (okra_lib_name_from_env_var != NULL)) {
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
178 handle = os::dll_load(okra_lib_name_from_env_var, ebuf, O_BUFLEN);
13740
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
179 if ((handle != NULL) && TraceGPUInteraction) {
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
180 tty->print_cr("[HSAIL] using _OKRA_SIM_LIB_PATH_=%s", getenv("_OKRA_SIM_LIB_PATH_"));
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
181 }
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
182 }
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
183
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
184 if (handle == NULL) {
13740
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
185 // Unable to dlopen okra
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
186 if (TraceGPUInteraction) {
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
187 tty->print_cr("[HSAIL] library load failed.");
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
188 }
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
189 return false;
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
190 }
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
191
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
192 guarantee(_okra_create_context == NULL, "cannot repeat GPU initialization");
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
193
13740
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
194 // at this point we know handle is valid and we can lookup the functions
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
195 LOOKUP_OKRA_FUNCTION(okra_create_context, okra_create_context);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
196 LOOKUP_OKRA_FUNCTION(okra_create_kernel, okra_create_kernel);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
197 LOOKUP_OKRA_FUNCTION(okra_push_object, okra_push_object);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
198 LOOKUP_OKRA_FUNCTION(okra_push_boolean, okra_push_boolean);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
199 LOOKUP_OKRA_FUNCTION(okra_push_byte, okra_push_byte);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
200 LOOKUP_OKRA_FUNCTION(okra_push_double, okra_push_double);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
201 LOOKUP_OKRA_FUNCTION(okra_push_float, okra_push_float);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
202 LOOKUP_OKRA_FUNCTION(okra_push_int, okra_push_int);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
203 LOOKUP_OKRA_FUNCTION(okra_push_long, okra_push_long);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
204 LOOKUP_OKRA_FUNCTION(okra_execute_with_range, okra_execute_with_range);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
205 LOOKUP_OKRA_FUNCTION(okra_clearargs, okra_clearargs);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
206 LOOKUP_OKRA_FUNCTION(okra_register_heap, okra_register_heap);
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
207 // if we made it this far, real success
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
208
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
209 gpu::initialized_gpu("Okra");
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
210
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
211 return true;
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
212 GPU_END
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
213
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
214 bool gpu::Hsail::register_natives(JNIEnv* env) {
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
215 jclass klass = env->FindClass("com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend");
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
216 if (klass == NULL) {
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
217 if (TraceGPUInteraction) {
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
218 tty->print_cr("HSAILHotSpotBackend class not found");
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
219 }
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
220 return false;
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
221 }
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
222 jint status = env->RegisterNatives(klass, HSAIL_methods, sizeof(HSAIL_methods) / sizeof(JNINativeMethod));
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
223 if (status != JNI_OK) {
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
224 if (TraceGPUInteraction) {
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
225 tty->print_cr("Error registering natives for HSAILHotSpotBackend: %d", status);
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
226 }
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
227 return false;
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13740
diff changeset
228 }
13740
bfd61161d752 HSAIL: support for using Okra simulator without needing to configure PATH and LD_LIBRARY_PATH
Doug Simon <doug.simon@oracle.com>
parents: 13115
diff changeset
229 return true;
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
230 }