Mercurial > hg > graal-jvmci-8
diff src/gpu/hsail/vm/gpu_hsail.hpp @ 13819:49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 30 Jan 2014 00:52:33 +0100 |
parents | bfd61161d752 |
children | 8053c3ede984 |
line wrap: on
line diff
--- a/src/gpu/hsail/vm/gpu_hsail.hpp Thu Jan 30 00:48:41 2014 +0100 +++ b/src/gpu/hsail/vm/gpu_hsail.hpp Thu Jan 30 00:52:33 2014 +0100 @@ -26,17 +26,27 @@ #define GPU_HSAIL_HPP class Hsail { - friend class gpu; + +private: + + static JNINativeMethod HSAIL_methods[]; - protected: - static bool probe_linkage(); - static bool initialize_gpu(); - static unsigned int total_cores(); - static void* generate_kernel(unsigned char *code, int code_len, const char *name); - static bool execute_kernel_void_1d(address kernel, int dimX, jobject args, methodHandle& mh); + // static native boolean initialize(); + static jboolean initialize(JNIEnv *env, jclass); + + // static native long generateKernel(byte[] targetCode, String name); + static jlong generate_kernel(JNIEnv *env, jclass, jbyteArray code_handle, jstring name_handle); + + // static native boolean executeKernel0(HotSpotInstalledCode kernel, int jobSize, Object[] args); + static jboolean execute_kernel_void_1d(JNIEnv *env, jclass, jobject hotspotInstalledCode, jint dimX, jobject args); + static void register_heap(); public: + + // Registers the implementations for the native methods in HSAILHotSpotBackend + static bool register_natives(JNIEnv* env); + #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) typedef unsigned long long CUdeviceptr; #else @@ -57,8 +67,6 @@ typedef bool (*okra_clearargs_func_t)(void*); typedef bool (*okra_register_heap_func_t)(void*, size_t); - static bool probe_linkage_internal(bool isRequired); - public: static okra_create_context_func_t _okra_create_context; static okra_create_kernel_func_t _okra_create_kernel;