Skip to content

Commit 3cb8683

Browse files
Process extra properties for Context
Change-Id: Ic4b3af368a734109188dcd725f1fcf8c17fbb59e Signed-off-by: Filip Hazubski <[email protected]>
1 parent 352450a commit 3cb8683

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

runtime/context/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
set(RUNTIME_SRCS_CONTEXT
88
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
99
${CMAKE_CURRENT_SOURCE_DIR}/context.cpp
10+
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/context_extra.cpp
1011
${CMAKE_CURRENT_SOURCE_DIR}/context.h
1112
${CMAKE_CURRENT_SOURCE_DIR}/context.inl
1213
${CMAKE_CURRENT_SOURCE_DIR}/driver_diagnostics.cpp

runtime/context/context.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ bool Context::createImpl(const cl_context_properties *properties,
110110
cl_platform_id pid = platform();
111111
if (reinterpret_cast<cl_platform_id>(propertyValue) != pid) {
112112
errcodeRet = CL_INVALID_PLATFORM;
113+
return false;
113114
}
114115
} break;
115116
case CL_CONTEXT_SHOW_DIAGNOSTICS_INTEL:
@@ -120,13 +121,13 @@ bool Context::createImpl(const cl_context_properties *properties,
120121
break;
121122
default:
122123
if (!sharingBuilder->processProperties(propertyType, propertyValue, errcodeRet)) {
123-
errcodeRet = CL_INVALID_PROPERTY;
124+
errcodeRet = processExtraProperties(propertyType, propertyValue);
125+
}
126+
if (errcodeRet != CL_SUCCESS) {
127+
return false;
124128
}
125129
break;
126130
}
127-
if (errcodeRet != CL_SUCCESS) {
128-
return false;
129-
}
130131
}
131132

132133
auto numProperties = ptrDiff(propertiesCurrent, properties) / sizeof(cl_context_properties);

runtime/context/context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ class Context : public BaseObject<_cl_context> {
125125
// OS specific implementation
126126
void *getOsContextInfo(cl_context_info &paramName, size_t *srcParamSize);
127127

128+
cl_int processExtraProperties(cl_context_properties propertyType, cl_context_properties propertyValue);
129+
128130
const cl_context_properties *properties;
129131
size_t numProperties;
130132
void(CL_CALLBACK *contextCallback)(const char *, const void *, size_t, void *);

runtime/context/context_extra.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (C) 2018 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "runtime/context/context.h"
9+
10+
namespace OCLRT {
11+
12+
cl_int Context::processExtraProperties(cl_context_properties propertyType, cl_context_properties propertyValue) {
13+
return CL_INVALID_PROPERTY;
14+
}
15+
16+
} // namespace OCLRT

0 commit comments

Comments
 (0)