annotate src/share/vm/runtime/gpu.cpp @ 16401:347915b8cea8

Move name from HotSpotNmethod to InstalledCode to have a name again for truffle nmethods.
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 02 Jul 2014 18:23:56 +0200
parents c846fbf318f3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 #include "precompiled.hpp"
147162b27799 GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
26 #include "runtime/gpu.hpp"
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents: 11842
diff changeset
27 #include "runtime/handles.hpp"
9430
147162b27799 GRAAL-234 - PTX code loading
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
28
15177
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
29 int Gpu::_initialized_gpus_count = 0;
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
30 Gpu* Gpu::_initialized_gpus[MAX_GPUS];
11606
4f69a5189e77 Create runtime object based on GPUIL type newly added to gpu class; some code refactoring.
bharadwaj
parents: 10879
diff changeset
31
15177
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
32 void Gpu::initialized_gpu(Gpu* gpu) {
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
33 // GPUs are always initialized on the same thread so no need for locking
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
34 guarantee(_initialized_gpus_count < MAX_GPUS, "oob");
15258
c846fbf318f3 fix log message stating how many GPUs have been initialized
Doug Simon <doug.simon@oracle.com>
parents: 15177
diff changeset
35 _initialized_gpus[_initialized_gpus_count++] = gpu;
15177
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
36 if (TraceGPUInteraction) {
15258
c846fbf318f3 fix log message stating how many GPUs have been initialized
Doug Simon <doug.simon@oracle.com>
parents: 15177
diff changeset
37 tty->print_cr("[GPU] registered initialization of %s (total initialized: %d)", gpu->name(), _initialized_gpus_count);
15177
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
38 }
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
39 }
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
40
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
41 void Gpu::safepoint_event(SafepointEvent event) {
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
42 for (int i = 0; i < _initialized_gpus_count; i++) {
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
43 if (event == SafepointBegin) {
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
44 _initialized_gpus[i]->notice_safepoints();
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
45 } else {
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
46 _initialized_gpus[i]->ignore_safepoints();
11606
4f69a5189e77 Create runtime object based on GPUIL type newly added to gpu class; some code refactoring.
bharadwaj
parents: 10879
diff changeset
47 }
15177
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 13819
diff changeset
48 }
12743
f1a55428a8d7 more HSAIL support in the C++ layer for executing HSAIL code on the simulator
Doug Simon <doug.simon@oracle.com>
parents: 11842
diff changeset
49 }