comparison src/share/vm/runtime/gpu.hpp @ 15177:66e3af78ea96

HSAIL: added safepoint support Contributed-by: Eric Caspole <eric.caspole@amd.com>
author Doug Simon <doug.simon@oracle.com>
date Thu, 17 Apr 2014 00:44:32 +0200
parents 51584f76462d
children de9ead115e26
comparison
equal deleted inserted replaced
15175:78f1a1a70628 15177:66e3af78ea96
27 27
28 #include "runtime/atomic.hpp" 28 #include "runtime/atomic.hpp"
29 #include "oops/symbol.hpp" 29 #include "oops/symbol.hpp"
30 #include "utilities/array.hpp" 30 #include "utilities/array.hpp"
31 31
32 #define MAX_GPUS 2
33
32 // Defines the interface to the graphics processor(s). 34 // Defines the interface to the graphics processor(s).
33 class gpu : AllStatic { 35 class Gpu {
34 private: 36 private:
35 static int _initialized_gpus; // number of initialize GPU devices 37 static int _initialized_gpus_count;
38 static Gpu* _initialized_gpus[MAX_GPUS];
36 39
37 public: 40 public:
38 41
39 // Notification of a GPU device that has been initialized. 42 // Notification of a GPU device that has been initialized.
40 static void initialized_gpu(const char* name); 43 static void initialized_gpu(Gpu* gpu);
41 44
42 // Gets a comma separated list of supported GPU architecture names. 45 // Gets a comma separated list of supported GPU architecture names.
43 static jobject probe_gpus(JNIEnv* env); 46 static jobject probe_gpus(JNIEnv* env);
44 47
45 // Gets the number of GPU devices that have been initialized. 48 // Gets the number of GPU devices that have been initialized.
46 static int initialized_gpus() { return _initialized_gpus; } 49 static int initialized_gpus() { return _initialized_gpus_count; }
50
51 enum SafepointEvent {
52 SafepointBegin,
53 SafepointEnd
54 };
55
56 // Called when a safepoint has been activated.
57 static void safepoint_event(SafepointEvent event);
58
59 // Name of this GPU
60 virtual const char* name() = 0;
61
62 // Called when a safepoint has been activated.
63 virtual void notice_safepoints() {};
64
65 // Called when a safepoint has been deactivated.
66 virtual void ignore_safepoints() {};
47 }; 67 };
48 68
49 #endif // SHARE_VM_RUNTIME_GPU_HPP 69 #endif // SHARE_VM_RUNTIME_GPU_HPP