Mercurial > hg > graal-jvmci-8
comparison src/gpu/ptx/vm/gpu_ptx.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 | 80cd5c3b8827 |
children | 8053c3ede984 |
comparison
equal
deleted
inserted
replaced
13818:d2f520f46180 | 13819:49db2c1e3bee |
---|---|
86 | 86 |
87 #define GRAAL_CU_CTX_MAP_HOST 0x08 | 87 #define GRAAL_CU_CTX_MAP_HOST 0x08 |
88 #define GRAAL_CU_CTX_SCHED_BLOCKING_SYNC 0x04 | 88 #define GRAAL_CU_CTX_SCHED_BLOCKING_SYNC 0x04 |
89 | 89 |
90 class Ptx { | 90 class Ptx { |
91 friend class gpu; | |
92 friend class PtxCall; | 91 friend class PtxCall; |
93 | 92 |
94 protected: | 93 private: |
95 static bool probe_linkage(); | 94 |
96 static bool initialize_gpu(); | 95 static JNINativeMethod PTX_methods[]; |
97 static unsigned int total_cores(); | 96 |
98 static void* get_context(); | 97 // static native boolean initialize(); |
99 static void* generate_kernel(unsigned char *code, int code_len, const char *name); | 98 static jboolean initialize(JNIEnv* env, jclass); |
100 static bool execute_warp(int dimX, int dimY, int dimZ, address kernel, PTXKernelArguments & ka, JavaValue &ret); | 99 |
101 static bool execute_kernel(address kernel, PTXKernelArguments & ka, JavaValue &ret); | 100 // static native long generateKernel(byte[] targetCode, String name); |
101 static jlong generate_kernel(JNIEnv *env, jclass, jbyteArray code_handle, jstring name_handle); | |
102 | |
103 // static native long getLaunchKernelAddress(); | |
104 static jlong get_execute_kernel_from_vm_address(JNIEnv *env, jclass); | |
105 | |
106 // static native int getAvailableProcessors0(); | |
107 static jint get_total_cores(JNIEnv *env, jobject); | |
108 | |
109 // Links the CUDA driver library functions | |
110 static bool link(); | |
111 | |
112 static int ncores(int major, int minor); | |
113 | |
102 public: | 114 public: |
115 // Registers the implementations for the native methods in PTXHotSpotBackend | |
116 static bool register_natives(JNIEnv* env); | |
117 | |
103 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) | 118 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) |
104 typedef unsigned long long CUdeviceptr; | 119 typedef unsigned long long CUdeviceptr; |
105 #else | 120 #else |
106 typedef unsigned int CUdeviceptr; | 121 typedef unsigned int CUdeviceptr; |
107 #endif | 122 #endif |