@@ -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,13 @@ 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 " , ENV_CL_CONTEXT_COMPILER_MODE_ALTERA, ENV_CL_CONTEXT_COMPILER_MODE_INTELFPGA );
590
590
}
591
591
592
592
if (override ) {
@@ -619,7 +619,7 @@ static cl_int l_load_properties(cl_context context,
619
619
// If the env var is not set, then use "aocl_program_library" in the
620
620
// current directory.
621
621
const auto *default_root = acl_getenv (
622
- " CL_CONTEXT_PROGRAM_EXE_LIBRARY_ROOT_INTELFPGA " ); // this one is public,
622
+ ENV_CL_CONTEXT_PROGRAM_EXE_LIBRARY_ROOT_INTELFPGA ); // this one is public,
623
623
// in cl_ext_intelfpga.h
624
624
if (!default_root) {
625
625
default_root = " aocl_program_library" ;
@@ -632,7 +632,7 @@ static cl_int l_load_properties(cl_context context,
632
632
// Get user-specified compile command.
633
633
// The default command depends on effective compiler mode, so defer
634
634
// until later.
635
- const char *default_cmd = acl_getenv (" CL_CONTEXT_COMPILE_COMMAND_INTELFPGA " );
635
+ const char *default_cmd = acl_getenv (ENV_CL_CONTEXT_COMPILE_COMMAND_INTELFPGA );
636
636
if (default_cmd) {
637
637
status = l_update_compile_command (context, default_cmd);
638
638
if (status != CL_SUCCESS)
@@ -1314,6 +1314,10 @@ void acl_context_callback(cl_context context, const std::string errinfo) {
1314
1314
notify_fn (errinfo.c_str (), 0 , 0 , notify_user_data);
1315
1315
}
1316
1316
}
1317
+
1318
+ if (context && acl_getenv (ENV_ACL_CONTEXT_CALLBACK_DEBUG)) {
1319
+ std::cout << " [acl_context_callback] " << errinfo << std::endl;
1320
+ }
1317
1321
}
1318
1322
1319
1323
// Called when runtime has been waiting for device update for a while
0 commit comments