From 5a749a48e10cfa3d6e4fc21fb066d7a0863ef00f Mon Sep 17 00:00:00 2001 From: Hans Pabst Date: Fri, 6 Dec 2024 15:52:07 +0100 Subject: [PATCH] ocl: adjusted internal settings --- src/acc/opencl/acc_opencl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/acc/opencl/acc_opencl.c b/src/acc/opencl/acc_opencl.c index cab7e358cfb..d7ee7651184 100644 --- a/src/acc/opencl/acc_opencl.c +++ b/src/acc/opencl/acc_opencl.c @@ -344,18 +344,22 @@ int c_dbcsr_acc_init(void) { # if defined(ACC_OPENCL_NCCS) if ((1 & c_dbcsr_acc_opencl_config.wa) && 0 != nccs && NULL == getenv("ZEX_NUMBER_OF_CCS")) { static char zex_nccs[ACC_OPENCL_MAXNDEVS * 8 + 32] = "ZEX_NUMBER_OF_CCS="; + const int mode = ((1 == nccs || 2 == nccs) ? nccs : 4); int j = strlen(zex_nccs); for (i = 0; i < ACC_OPENCL_MAXNDEVS; ++i) { const char* const istr = (0 < i ? ",%u:%i" : "%u:%i"); - const int n = LIBXSMM_SNPRINTF(zex_nccs + j, sizeof(zex_nccs) - j, istr, i, LIBXSMM_CLMP(nccs, 1, 4)); + const int n = LIBXSMM_SNPRINTF(zex_nccs + j, sizeof(zex_nccs) - j, istr, i, mode); if (0 < n) j += n; else { j = 0; break; } } - /* environment is populated before touching the compute runtime */ - if (0 < j) ACC_OPENCL_EXPECT(0 == LIBXSMM_PUTENV(zex_nccs)); /* soft-error */ + if (0 < j && 0 == LIBXSMM_PUTENV(zex_nccs) && /* populate before touching the compute runtime */ + (2 <= c_dbcsr_acc_opencl_config.verbosity || 0 > c_dbcsr_acc_opencl_config.verbosity)) + { + fprintf(stderr, "INFO ACC/OpenCL: support multiple separate compute command streamers (%i-CCS mode)\n", mode); + } } assert(EXIT_SUCCESS == result); # endif @@ -379,7 +383,7 @@ int c_dbcsr_acc_init(void) { } assert(EXIT_SUCCESS == result); # endif - if (~(1 + 2) & c_dbcsr_acc_opencl_config.wa) { /* environment is populated before touching the compute runtime */ + if (~(1 + 2 + 32) & c_dbcsr_acc_opencl_config.wa) { /* environment is populated before touching the compute runtime */ static char a[] = "NEOReadDebugKeys=1", b[] = "ZE_FLAT_DEVICE_HIERARCHY=COMPOSITE", c[] = "EnableRecoverablePageFaults=0"; static char d[] = "DirectSubmissionOverrideBlitterSupport=0", *key_value[] = {a, b, c, d}; if (NULL == env_neo) ACC_OPENCL_EXPECT(0 == LIBXSMM_PUTENV(key_value[0]));