Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/arguments.cpp @ 12490:4dba97fb1a6f
available GPUs are exposed to Graal only by the graal.gpu.isalist system property which is set up during command line argument parsing
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 18 Oct 2013 23:55:35 +0200 |
parents | 359f7e70ae7f |
children | b699233403ad |
comparison
equal
deleted
inserted
replaced
12489:0c651af30cc8 | 12490:4dba97fb1a6f |
---|---|
33 #include "memory/universe.inline.hpp" | 33 #include "memory/universe.inline.hpp" |
34 #include "oops/oop.inline.hpp" | 34 #include "oops/oop.inline.hpp" |
35 #include "prims/jvmtiExport.hpp" | 35 #include "prims/jvmtiExport.hpp" |
36 #include "runtime/arguments.hpp" | 36 #include "runtime/arguments.hpp" |
37 #include "runtime/globals_extension.hpp" | 37 #include "runtime/globals_extension.hpp" |
38 #include "runtime/gpu.hpp" | |
38 #include "runtime/java.hpp" | 39 #include "runtime/java.hpp" |
39 #include "services/management.hpp" | 40 #include "services/management.hpp" |
40 #include "services/memTracker.hpp" | 41 #include "services/memTracker.hpp" |
41 #include "utilities/defaultStream.hpp" | 42 #include "utilities/defaultStream.hpp" |
42 #include "utilities/macros.hpp" | 43 #include "utilities/macros.hpp" |
128 SystemProperty *Arguments::_sun_boot_library_path = NULL; | 129 SystemProperty *Arguments::_sun_boot_library_path = NULL; |
129 SystemProperty *Arguments::_java_library_path = NULL; | 130 SystemProperty *Arguments::_java_library_path = NULL; |
130 SystemProperty *Arguments::_java_home = NULL; | 131 SystemProperty *Arguments::_java_home = NULL; |
131 SystemProperty *Arguments::_java_class_path = NULL; | 132 SystemProperty *Arguments::_java_class_path = NULL; |
132 SystemProperty *Arguments::_sun_boot_class_path = NULL; | 133 SystemProperty *Arguments::_sun_boot_class_path = NULL; |
134 #ifdef GRAAL | |
135 SystemProperty *Arguments::_graal_gpu_isalist = NULL; | |
136 #endif | |
133 | 137 |
134 char* Arguments::_meta_index_path = NULL; | 138 char* Arguments::_meta_index_path = NULL; |
135 char* Arguments::_meta_index_dir = NULL; | 139 char* Arguments::_meta_index_dir = NULL; |
136 | 140 |
137 // Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string | 141 // Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string |
191 _java_library_path = new SystemProperty("java.library.path", NULL, true); | 195 _java_library_path = new SystemProperty("java.library.path", NULL, true); |
192 _java_home = new SystemProperty("java.home", NULL, true); | 196 _java_home = new SystemProperty("java.home", NULL, true); |
193 _sun_boot_class_path = new SystemProperty("sun.boot.class.path", NULL, true); | 197 _sun_boot_class_path = new SystemProperty("sun.boot.class.path", NULL, true); |
194 | 198 |
195 _java_class_path = new SystemProperty("java.class.path", "", true); | 199 _java_class_path = new SystemProperty("java.class.path", "", true); |
200 #ifdef GRAAL | |
201 _graal_gpu_isalist = new SystemProperty("graal.gpu.isalist", NULL, true); | |
202 #endif | |
196 | 203 |
197 // Add to System Property list. | 204 // Add to System Property list. |
198 PropertyList_add(&_system_properties, _java_ext_dirs); | 205 PropertyList_add(&_system_properties, _java_ext_dirs); |
199 PropertyList_add(&_system_properties, _java_endorsed_dirs); | 206 PropertyList_add(&_system_properties, _java_endorsed_dirs); |
200 PropertyList_add(&_system_properties, _sun_boot_library_path); | 207 PropertyList_add(&_system_properties, _sun_boot_library_path); |
201 PropertyList_add(&_system_properties, _java_library_path); | 208 PropertyList_add(&_system_properties, _java_library_path); |
202 PropertyList_add(&_system_properties, _java_home); | 209 PropertyList_add(&_system_properties, _java_home); |
203 PropertyList_add(&_system_properties, _java_class_path); | 210 PropertyList_add(&_system_properties, _java_class_path); |
204 PropertyList_add(&_system_properties, _sun_boot_class_path); | 211 PropertyList_add(&_system_properties, _sun_boot_class_path); |
212 #ifdef GRAAL | |
213 PropertyList_add(&_system_properties, _graal_gpu_isalist); | |
214 #endif | |
205 | 215 |
206 // Set OS specific system properties values | 216 // Set OS specific system properties values |
207 os::init_system_properties_values(); | 217 os::init_system_properties_values(); |
208 } | 218 } |
209 | 219 |
3799 if (!set) { | 3809 if (!set) { |
3800 FLAG_SET_DEFAULT(PauseAtExit, true); | 3810 FLAG_SET_DEFAULT(PauseAtExit, true); |
3801 } | 3811 } |
3802 } | 3812 } |
3803 | 3813 |
3814 #ifdef GRAAL | |
3815 if (_graal_gpu_isalist->value() == NULL) { | |
3816 // Initialize the graal.gpu.isalist system property if | |
3817 // a) it was not explicitly defined by the user and | |
3818 // b) at least one GPU is available. | |
3819 // GPU offload can be disabled by setting the property | |
3820 // to the empty string on the command line | |
3821 if (gpu::is_available() && gpu::has_gpu_linkage()) { | |
3822 if (gpu::get_target_il_type() == gpu::PTX) { | |
3823 _graal_gpu_isalist->append_value("PTX"); | |
3824 } | |
3825 if (gpu::get_target_il_type() == gpu::HSAIL) { | |
3826 _graal_gpu_isalist->append_value("HSAIL"); | |
3827 } | |
3828 } | |
3829 } | |
3830 #endif | |
3831 | |
3804 return JNI_OK; | 3832 return JNI_OK; |
3805 } | 3833 } |
3806 | 3834 |
3807 jint Arguments::adjust_after_os() { | 3835 jint Arguments::adjust_after_os() { |
3808 #if INCLUDE_ALL_GCS | 3836 #if INCLUDE_ALL_GCS |