mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Change signature of clAddCommentINTEL function: pass device instead of platform
Resolves: NEO-3939 Change-Id: I394ef7c2370771569a0ec50ac4644782ce8a384f Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
16c6d7eb9b
commit
e27c5a9475
@@ -5071,13 +5071,17 @@ CL_API_ENTRY cl_int CL_API_CALL clEnqueueVerifyMemoryINTEL(cl_command_queue comm
|
||||
return retVal;
|
||||
}
|
||||
|
||||
cl_int CL_API_CALL clAddCommentINTEL(cl_platform_id platform, const char *comment) {
|
||||
cl_int CL_API_CALL clAddCommentINTEL(cl_device_id device, const char *comment) {
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
API_ENTER(&retVal);
|
||||
DBG_LOG_INPUTS("platform", platform, "comment", comment);
|
||||
DBG_LOG_INPUTS("device", device, "comment", comment);
|
||||
|
||||
auto executionEnvironment = ::platform()->peekExecutionEnvironment();
|
||||
auto aubCenter = executionEnvironment->rootDeviceEnvironments[0]->aubCenter.get();
|
||||
Device *pDevice = nullptr;
|
||||
retVal = validateObjects(WithCastToInternal(device, &pDevice));
|
||||
if (retVal != CL_SUCCESS) {
|
||||
return retVal;
|
||||
}
|
||||
auto aubCenter = pDevice->getRootDeviceEnvironment().aubCenter.get();
|
||||
|
||||
if (!comment || (aubCenter && !aubCenter->getAubManager())) {
|
||||
retVal = CL_INVALID_VALUE;
|
||||
|
||||
@@ -861,7 +861,7 @@ cl_int CL_API_CALL clEnqueueVerifyMemoryINTEL(
|
||||
size_t sizeOfComparison,
|
||||
cl_uint comparisonMode);
|
||||
|
||||
cl_int CL_API_CALL clAddCommentINTEL(cl_platform_id platform, const char *comment);
|
||||
cl_int CL_API_CALL clAddCommentINTEL(cl_device_id device, const char *comment);
|
||||
|
||||
// OpenCL 2.1
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ class Device : public BaseObject<_cl_device_id> {
|
||||
MOCKABLE_VIRTUAL bool isSourceLevelDebuggerActive() const;
|
||||
SourceLevelDebugger *getSourceLevelDebugger() { return executionEnvironment->sourceLevelDebugger.get(); }
|
||||
ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; }
|
||||
const RootDeviceEnvironment &getRootDeviceEnvironment() const { return *executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]; }
|
||||
const HardwareCapabilities &getHardwareCapabilities() const { return hardwareCapabilities; }
|
||||
bool isFullRangeSvm() const {
|
||||
return executionEnvironment->isFullRangeSvm();
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#include "core/execution_environment/root_device_environment.h"
|
||||
#include "runtime/context/context.h"
|
||||
#include "runtime/device/device.h"
|
||||
#include "runtime/execution_environment/execution_environment.h"
|
||||
#include "runtime/platform/platform.h"
|
||||
#include "unit_tests/api/cl_api_tests.h"
|
||||
@@ -16,22 +18,37 @@ using namespace NEO;
|
||||
|
||||
namespace ULT {
|
||||
|
||||
using clAddCommentToAubTest = api_tests;
|
||||
struct clAddCommentToAubTest : api_tests {
|
||||
void SetUp() override {
|
||||
api_tests::SetUp();
|
||||
pDevice = pContext->getDevice(0);
|
||||
}
|
||||
void TearDown() override {
|
||||
api_tests::TearDown();
|
||||
}
|
||||
|
||||
Device *pDevice = nullptr;
|
||||
};
|
||||
|
||||
TEST_F(clAddCommentToAubTest, givenProperCommentNullptrAubCenterWhenAddCommentToAubThenSuccessIsReturned) {
|
||||
auto retVal = clAddCommentINTEL(pPlatform, "comment");
|
||||
auto retVal = clAddCommentINTEL(pDevice, "comment");
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
TEST_F(clAddCommentToAubTest, givenInvalidDeviceWhenAddCommentToAubThenErrorIsReturned) {
|
||||
auto retVal = clAddCommentINTEL(nullptr, "comment");
|
||||
EXPECT_EQ(CL_INVALID_DEVICE, retVal);
|
||||
}
|
||||
|
||||
TEST_F(clAddCommentToAubTest, givenNullptrCommentWhenAddCommentToAubThenErrorIsReturned) {
|
||||
auto retVal = clAddCommentINTEL(pPlatform, nullptr);
|
||||
auto retVal = clAddCommentINTEL(pDevice, nullptr);
|
||||
EXPECT_EQ(CL_INVALID_VALUE, retVal);
|
||||
}
|
||||
|
||||
TEST_F(clAddCommentToAubTest, givenAubCenterAndProperCommentButNullptrAubManagerWhenAddCommentToAubThenErrorIsReturned) {
|
||||
pPlatform->peekExecutionEnvironment()->rootDeviceEnvironments[testedRootDeviceIndex]->aubCenter.reset(new MockAubCenter());
|
||||
|
||||
auto retVal = clAddCommentINTEL(pPlatform, "comment");
|
||||
auto retVal = clAddCommentINTEL(pDevice, "comment");
|
||||
EXPECT_EQ(CL_INVALID_VALUE, retVal);
|
||||
}
|
||||
|
||||
@@ -51,7 +68,7 @@ TEST_F(clAddCommentToAubTest, givenProperCommentAubCenterAndAubManagerWhenAddCom
|
||||
|
||||
EXPECT_FALSE(mockAubManager->addCommentCalled);
|
||||
|
||||
auto retVal = clAddCommentINTEL(pPlatform, "comment");
|
||||
auto retVal = clAddCommentINTEL(pDevice, "comment");
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_TRUE(mockAubManager->addCommentCalled);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user