@@ -474,7 +474,7 @@ static cl_context l_create_context(const cl_context_properties *properties,
474
474
// Blocking multiple_processing
475
475
const char *allow_mp = NULL ;
476
476
// Check if user wants to disable the check.
477
- allow_mp = acl_getenv (" CL_CONTEXT_ALLOW_MULTIPROCESSING_INTELFPGA " );
477
+ allow_mp = acl_getenv (ENV_CL_CONTEXT_ALLOW_MULTIPROCESSING_INTELFPGA );
478
478
if (!allow_mp && platform_owner_pid != 0 &&
479
479
platform_owner_pid != acl_get_pid ()) {
480
480
if (pfn_notify) {
@@ -565,7 +565,7 @@ static cl_int l_load_properties(cl_context context,
565
565
566
566
// This one is only overridden with an environment variable.
567
567
{
568
- const char *override = acl_getenv (" AOCL_EAGERLY_LOAD_FIRST_BINARY " );
568
+ const char *override = acl_getenv (ENV_AOCL_EAGERLY_LOAD_FIRST_BINARY );
569
569
if (override ) {
570
570
// There was a string.
571
571
char *endptr = 0 ;
@@ -580,13 +580,15 @@ static cl_int l_load_properties(cl_context context,
580
580
{
581
581
const char *override = 0 ;
582
582
const char *override_deprecated = 0 ;
583
- override = acl_getenv (" CL_CONTEXT_COMPILER_MODE_INTELFPGA " );
584
- override_deprecated = acl_getenv (" CL_CONTEXT_COMPILER_MODE_ALTERA " );
583
+ override = acl_getenv (ENV_CL_CONTEXT_COMPILER_MODE_INTELFPGA );
584
+ override_deprecated = acl_getenv (ENV_CL_CONTEXT_COMPILER_MODE_ALTERA );
585
585
if (!override && override_deprecated) {
586
586
override = override_deprecated;
587
587
fprintf (stderr,
588
- " Warning: CL_CONTEXT_COMPILER_MODE_ALTERA has been deprecated. "
589
- " Use CL_CONTEXT_COMPILER_MODE_INTELFPGA instead.\n " );
588
+ " Warning: %s has been deprecated. "
589
+ " Use %s instead.\n " ,
590
+ ENV_CL_CONTEXT_COMPILER_MODE_ALTERA,
591
+ ENV_CL_CONTEXT_COMPILER_MODE_INTELFPGA);
590
592
}
591
593
592
594
if (override ) {
@@ -619,8 +621,9 @@ static cl_int l_load_properties(cl_context context,
619
621
// If the env var is not set, then use "aocl_program_library" in the
620
622
// current directory.
621
623
const auto *default_root = acl_getenv (
622
- " CL_CONTEXT_PROGRAM_EXE_LIBRARY_ROOT_INTELFPGA" ); // this one is public,
623
- // in cl_ext_intelfpga.h
624
+ ENV_CL_CONTEXT_PROGRAM_EXE_LIBRARY_ROOT_INTELFPGA); // this one is public,
625
+ // in
626
+ // cl_ext_intelfpga.h
624
627
if (!default_root) {
625
628
default_root = " aocl_program_library" ;
626
629
}
@@ -632,7 +635,8 @@ static cl_int l_load_properties(cl_context context,
632
635
// Get user-specified compile command.
633
636
// The default command depends on effective compiler mode, so defer
634
637
// until later.
635
- const char *default_cmd = acl_getenv (" CL_CONTEXT_COMPILE_COMMAND_INTELFPGA" );
638
+ const char *default_cmd =
639
+ acl_getenv (ENV_CL_CONTEXT_COMPILE_COMMAND_INTELFPGA);
636
640
if (default_cmd) {
637
641
status = l_update_compile_command (context, default_cmd);
638
642
if (status != CL_SUCCESS)
@@ -1314,6 +1318,10 @@ void acl_context_callback(cl_context context, const std::string errinfo) {
1314
1318
notify_fn (errinfo.c_str (), 0 , 0 , notify_user_data);
1315
1319
}
1316
1320
}
1321
+
1322
+ if (context && acl_getenv (ENV_ACL_CONTEXT_CALLBACK_DEBUG)) {
1323
+ std::cout << " [acl_context_callback] Error Info: " << errinfo << std::endl;
1324
+ }
1317
1325
}
1318
1326
1319
1327
// Called when runtime has been waiting for device update for a while
0 commit comments