diff 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
line wrap: on
line diff
--- a/src/gpu/ptx/vm/gpu_ptx.hpp	Thu Jan 30 00:48:41 2014 +0100
+++ b/src/gpu/ptx/vm/gpu_ptx.hpp	Thu Jan 30 00:52:33 2014 +0100
@@ -88,18 +88,33 @@
 #define GRAAL_CU_CTX_SCHED_BLOCKING_SYNC 0x04
 
 class Ptx {
-  friend class gpu;
   friend class PtxCall;
 
- protected:
-  static bool probe_linkage();
-  static bool initialize_gpu();
-  static unsigned int total_cores();
-  static void* get_context();
-  static void* generate_kernel(unsigned char *code, int code_len, const char *name);
-  static bool execute_warp(int dimX, int dimY, int dimZ, address kernel, PTXKernelArguments & ka, JavaValue &ret);
-  static bool execute_kernel(address kernel, PTXKernelArguments & ka, JavaValue &ret);
+private:
+
+  static JNINativeMethod PTX_methods[];
+
+  // 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 long getLaunchKernelAddress();
+  static jlong get_execute_kernel_from_vm_address(JNIEnv *env, jclass);
+
+  // static native int getAvailableProcessors0();
+  static jint get_total_cores(JNIEnv *env, jobject);
+
+  // Links the CUDA driver library functions
+  static bool link();
+
+  static int ncores(int major, int minor);
+
 public:
+  // Registers the implementations for the native methods in PTXHotSpotBackend
+  static bool register_natives(JNIEnv* env);
+
 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
   typedef unsigned long long CUdeviceptr;
 #else