@@ -175,13 +175,10 @@ cl_int acl_device_binary_t::load_binary_pkg(int validate_compile_options,
175
175
#define FAILREAD_MSG " Could not read parts of the program binary."
176
176
size_t data_len = 0 ;
177
177
178
- int env_override = 0 ;
179
-
180
178
acl_assert_locked ();
181
179
182
- (void )acl_get_offline_device_user_setting (&env_override);
183
-
184
- if (env_override == ACL_CONTEXT_MPSIM && !validate_compile_options &&
180
+ if (acl_platform.offline_mode == ACL_CONTEXT_MPSIM &&
181
+ !validate_compile_options &&
185
182
context->compiler_mode != CL_CONTEXT_COMPILER_MODE_OFFLINE_INTELFPGA &&
186
183
get_binary_len () < 1024 ) {
187
184
// IF the binary is ridiculously small (arbitrary number) we are going
@@ -258,7 +255,7 @@ cl_int acl_device_binary_t::load_binary_pkg(int validate_compile_options,
258
255
// runtime.
259
256
if (acl_pkg_section_exists (pkg, " .acl.rand_hash" , &data_len) &&
260
257
dev_prog->device ->loaded_bin == nullptr &&
261
- env_override != ACL_CONTEXT_MPSIM) {
258
+ acl_platform. offline_mode != ACL_CONTEXT_MPSIM) {
262
259
std::vector<char > pkg_rand_hash (data_len + 1 );
263
260
AND_CHECK (acl_pkg_read_section (pkg, " .acl.rand_hash" , pkg_rand_hash.data (),
264
261
data_len + 1 ),
@@ -305,7 +302,7 @@ cl_int acl_device_binary_t::load_binary_pkg(int validate_compile_options,
305
302
// For simulator flow, we treat as if the device has already been
306
303
// programmed and check device global memory layout against
307
304
// dev_prog->device->last_bin
308
- if (env_override == ACL_CONTEXT_MPSIM) {
305
+ if (acl_platform. offline_mode == ACL_CONTEXT_MPSIM) {
309
306
if (validate_memory_layout && dev_prog->device ->last_bin ) {
310
307
AND_CHECK (get_devdef ().autodiscovery_def .num_global_mem_systems <=
311
308
1 ||
@@ -357,7 +354,7 @@ cl_int acl_device_binary_t::load_binary_pkg(int validate_compile_options,
357
354
is_simulator = 0 ;
358
355
if (status == CL_SUCCESS &&
359
356
acl_pkg_section_exists (pkg, " .acl.simulator_object" , &data_len)) {
360
- if (env_override != ACL_CONTEXT_MPSIM) {
357
+ if (acl_platform. offline_mode != ACL_CONTEXT_MPSIM) {
361
358
acl_context_callback (
362
359
context,
363
360
" aocx contains simulated kernel, but simulation mode not set!" );
@@ -382,7 +379,7 @@ cl_int acl_device_binary_t::load_binary_pkg(int validate_compile_options,
382
379
context,
383
380
" aocx contains unsupported legacy opencl emulated kernel for windows!" );
384
381
}
385
- if (status == CL_SUCCESS && env_override == ACL_CONTEXT_MPSIM &&
382
+ if (status == CL_SUCCESS && acl_platform. offline_mode == ACL_CONTEXT_MPSIM &&
386
383
!is_simulator) {
387
384
acl_context_callback (context,
388
385
" Simulation mode set but aocx is for hardware!" );
0 commit comments