Skip to content

Commit

Permalink
Process extra properties for Context
Browse files Browse the repository at this point in the history
Change-Id: Ic4b3af368a734109188dcd725f1fcf8c17fbb59e
Signed-off-by: Filip Hazubski <[email protected]>
  • Loading branch information
fhazubski-Intel authored and Compute-Runtime-Automation committed Nov 22, 2018
1 parent 352450a commit 3cb8683
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions runtime/context/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
set(RUNTIME_SRCS_CONTEXT
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/context.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/context_extra.cpp
${CMAKE_CURRENT_SOURCE_DIR}/context.h
${CMAKE_CURRENT_SOURCE_DIR}/context.inl
${CMAKE_CURRENT_SOURCE_DIR}/driver_diagnostics.cpp
Expand Down
9 changes: 5 additions & 4 deletions runtime/context/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ bool Context::createImpl(const cl_context_properties *properties,
cl_platform_id pid = platform();
if (reinterpret_cast<cl_platform_id>(propertyValue) != pid) {
errcodeRet = CL_INVALID_PLATFORM;
return false;
}
} break;
case CL_CONTEXT_SHOW_DIAGNOSTICS_INTEL:
Expand All @@ -120,13 +121,13 @@ bool Context::createImpl(const cl_context_properties *properties,
break;
default:
if (!sharingBuilder->processProperties(propertyType, propertyValue, errcodeRet)) {
errcodeRet = CL_INVALID_PROPERTY;
errcodeRet = processExtraProperties(propertyType, propertyValue);
}
if (errcodeRet != CL_SUCCESS) {
return false;
}
break;
}
if (errcodeRet != CL_SUCCESS) {
return false;
}
}

auto numProperties = ptrDiff(propertiesCurrent, properties) / sizeof(cl_context_properties);
Expand Down
2 changes: 2 additions & 0 deletions runtime/context/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ class Context : public BaseObject<_cl_context> {
// OS specific implementation
void *getOsContextInfo(cl_context_info &paramName, size_t *srcParamSize);

cl_int processExtraProperties(cl_context_properties propertyType, cl_context_properties propertyValue);

const cl_context_properties *properties;
size_t numProperties;
void(CL_CALLBACK *contextCallback)(const char *, const void *, size_t, void *);
Expand Down
16 changes: 16 additions & 0 deletions runtime/context/context_extra.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/

#include "runtime/context/context.h"

namespace OCLRT {

cl_int Context::processExtraProperties(cl_context_properties propertyType, cl_context_properties propertyValue) {
return CL_INVALID_PROPERTY;
}

} // namespace OCLRT

0 comments on commit 3cb8683

Please sign in to comment.