comparison src/share/vm/runtime/gpu.hpp @ 11606:4f69a5189e77

Create runtime object based on GPUIL type newly added to gpu class; some code refactoring.
author bharadwaj
date Wed, 11 Sep 2013 17:02:40 -0400
parents 49bb1bc983c6
children 365d8f385fb5
comparison
equal deleted inserted replaced
11605:3676540f71cf 11606:4f69a5189e77
34 // GPU services such as graphics kernel load and execute. 34 // GPU services such as graphics kernel load and execute.
35 35
36 36
37 class gpu: AllStatic { 37 class gpu: AllStatic {
38 public: 38 public:
39
40 enum TargetGPUIL { NONE = 0, PTX = 1, HSAIL = 2};
39 static void init(void); 41 static void init(void);
40 42
41 static void probe_gpu(); 43 static void probe_gpu();
42 44
43 static void probe_linkage();
44
45 static void initialize_gpu(); 45 static void initialize_gpu();
46 46
47 static void * generate_kernel(unsigned char *code, int code_len, const char *name); 47 static void * generate_kernel(unsigned char *code, int code_len, const char *name);
48 48
49 static bool execute_kernel(address kernel, PTXKernelArguments & ptxka, JavaValue & ret); 49 static bool execute_kernel(address kernel, PTXKernelArguments & ptxka, JavaValue & ret);
64 _gpu_linkage = value; 64 _gpu_linkage = value;
65 } 65 }
66 66
67 static bool has_gpu_linkage() { return _gpu_linkage; } 67 static bool has_gpu_linkage() { return _gpu_linkage; }
68 68
69 static void set_target_il_type(TargetGPUIL value) {
70 _targetIL = value;
71 }
72
73 static enum gpu::TargetGPUIL get_target_il_type() {
74 return _targetIL;
75 }
76
69 protected: 77 protected:
70 static bool _available; 78 static bool _available;
71 static bool _gpu_linkage; 79 static bool _gpu_linkage;
72 static bool _initialized; 80 static bool _initialized;
81 static TargetGPUIL _targetIL;
73 82
74 // Platform dependent stuff 83 // Platform dependent stuff
75 #ifdef TARGET_OS_FAMILY_linux 84 #ifdef TARGET_OS_FAMILY_linux
76 # include "gpu_linux.hpp" 85 # include "gpu_linux.hpp"
77 #endif 86 #endif