Mercurial > hg > truffle
annotate src/share/vm/runtime/gpu.hpp @ 16704:3cd605c98060
NFI: cleanup
author | Matthias Grimmer <grimmer@ssw.jku.at> |
---|---|
date | Wed, 06 Aug 2014 08:27:42 +0200 |
parents | de9ead115e26 |
children |
rev | line source |
---|---|
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
1 /* |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
4 * |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
8 * |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
14 * |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
18 * |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
21 * questions. |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
22 * |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
23 */ |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
24 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
25 #ifndef SHARE_VM_RUNTIME_GPU_HPP |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
26 #define SHARE_VM_RUNTIME_GPU_HPP |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
27 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
28 #include "runtime/atomic.hpp" |
11485
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11283
diff
changeset
|
29 #include "oops/symbol.hpp" |
13819
49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents:
12743
diff
changeset
|
30 #include "utilities/array.hpp" |
11485
49bb1bc983c6
Implement several missing PTX codegen features; return value capture and method args passing of java method executed on GPU.
bharadwaj
parents:
11283
diff
changeset
|
31 |
15177
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
32 #define MAX_GPUS 2 |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
33 |
13819
49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents:
12743
diff
changeset
|
34 // Defines the interface to the graphics processor(s). |
15206
de9ead115e26
Gpu needs to extend one of the allocation classes
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15177
diff
changeset
|
35 class Gpu : public CHeapObj<mtInternal> { |
13819
49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents:
12743
diff
changeset
|
36 private: |
15177
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
37 static int _initialized_gpus_count; |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
38 static Gpu* _initialized_gpus[MAX_GPUS]; |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
39 |
13819
49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents:
12743
diff
changeset
|
40 public: |
11606
4f69a5189e77
Create runtime object based on GPUIL type newly added to gpu class; some code refactoring.
bharadwaj
parents:
11485
diff
changeset
|
41 |
13888
51584f76462d
pulled Ptx and Hsail classes out of gpu class namespace
Doug Simon <doug.simon@oracle.com>
parents:
13848
diff
changeset
|
42 // Notification of a GPU device that has been initialized. |
15177
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
43 static void initialized_gpu(Gpu* gpu); |
13888
51584f76462d
pulled Ptx and Hsail classes out of gpu class namespace
Doug Simon <doug.simon@oracle.com>
parents:
13848
diff
changeset
|
44 |
13819
49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents:
12743
diff
changeset
|
45 // Gets a comma separated list of supported GPU architecture names. |
49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents:
12743
diff
changeset
|
46 static jobject probe_gpus(JNIEnv* env); |
49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents:
12743
diff
changeset
|
47 |
13888
51584f76462d
pulled Ptx and Hsail classes out of gpu class namespace
Doug Simon <doug.simon@oracle.com>
parents:
13848
diff
changeset
|
48 // Gets the number of GPU devices that have been initialized. |
15177
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
49 static int initialized_gpus() { return _initialized_gpus_count; } |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
50 |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
51 enum SafepointEvent { |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
52 SafepointBegin, |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
53 SafepointEnd |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
54 }; |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
55 |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
56 // Called when a safepoint has been activated. |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
57 static void safepoint_event(SafepointEvent event); |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
58 |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
59 // Name of this GPU |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
60 virtual const char* name() = 0; |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
61 |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
62 // Called when a safepoint has been activated. |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
63 virtual void notice_safepoints() {}; |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
64 |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
65 // Called when a safepoint has been deactivated. |
66e3af78ea96
HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents:
13888
diff
changeset
|
66 virtual void ignore_safepoints() {}; |
9430
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
67 }; |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
68 |
147162b27799
GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
69 #endif // SHARE_VM_RUNTIME_GPU_HPP |