@@ -37,7 +37,7 @@ T *Program::create(
3737 auto pContext = castToObject<Context>(context);
3838 DEBUG_BREAK_IF (!pContext);
3939
40- auto program = new T (pContext, false );
40+ auto program = new T (*pContext-> getDevice ( 0 )-> getExecutionEnvironment (), pContext, false );
4141
4242 auto retVal = program->createProgramFromBinary (binaries[0 ], lengths[0 ]);
4343
@@ -76,7 +76,7 @@ T *Program::create(
7676 lengths);
7777
7878 if (CL_SUCCESS == retVal) {
79- program = new T (pContext, false );
79+ program = new T (*pContext-> getDevice ( 0 )-> getExecutionEnvironment (), pContext, false );
8080 program->sourceCode .swap (combinedString);
8181 }
8282
@@ -99,7 +99,7 @@ T *Program::create(
9999 }
100100
101101 if (retVal == CL_SUCCESS) {
102- program = new T ();
102+ program = new T (*device. getExecutionEnvironment () );
103103 program->setSource ((char *)nullTerminatedString);
104104 program->context = context;
105105 program->isBuiltIn = isBuiltIn;
@@ -136,7 +136,7 @@ T *Program::createFromGenBinary(
136136 }
137137
138138 if (CL_SUCCESS == retVal) {
139- program = new T (context, isBuiltIn);
139+ program = new T (executionEnvironment, context, isBuiltIn);
140140 program->numDevices = 1 ;
141141 program->storeGenBinary (binary, size);
142142 program->isCreatedFromBinary = true ;
@@ -164,7 +164,7 @@ T *Program::createFromIL(Context *ctx,
164164 return nullptr ;
165165 }
166166
167- T *program = new T (ctx, false );
167+ T *program = new T (*ctx-> getDevice ( 0 )-> getExecutionEnvironment (), ctx, false );
168168 errcodeRet = program->createProgramFromBinary (il, length);
169169 if (errcodeRet != CL_SUCCESS) {
170170 delete program;
0 commit comments