mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Adjust clGetKernelWorkGroupInfo api call
Signed-off-by: Sebastian Luzynski <sebastian.jozef.luzynski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
d399613f25
commit
0871c1bb76
@ -30,6 +30,7 @@ set(IGDRCL_SRCS_tests_fixtures
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_data_fixture.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_data_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_work_group_info_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/media_kernel_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_allocator_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_allocator_multi_device_fixture.h
|
||||
|
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/file_io.h"
|
||||
#include "shared/test/unit_test/helpers/test_files.h"
|
||||
|
||||
#include "opencl/test/unit_test/api/cl_api_tests.h"
|
||||
#include "opencl/test/unit_test/helpers/kernel_binary_helper.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
struct clGetKernelWorkGroupInfoTest : public ApiFixture<>,
|
||||
public ::testing::Test {
|
||||
typedef ApiFixture BaseClass;
|
||||
|
||||
void SetUp() override {
|
||||
BaseClass::SetUp();
|
||||
|
||||
std::unique_ptr<char[]> pSource = nullptr;
|
||||
size_t sourceSize = 0;
|
||||
std::string testFile;
|
||||
|
||||
kbHelper = new KernelBinaryHelper("CopyBuffer_simd16", false);
|
||||
testFile.append(clFiles);
|
||||
testFile.append("CopyBuffer_simd16.cl");
|
||||
ASSERT_EQ(true, fileExists(testFile));
|
||||
|
||||
pSource = loadDataFromFile(
|
||||
testFile.c_str(),
|
||||
sourceSize);
|
||||
ASSERT_NE(0u, sourceSize);
|
||||
ASSERT_NE(nullptr, pSource);
|
||||
|
||||
const char *sources[1] = {pSource.get()};
|
||||
pProgram = clCreateProgramWithSource(
|
||||
pContext,
|
||||
1,
|
||||
sources,
|
||||
&sourceSize,
|
||||
&retVal);
|
||||
EXPECT_NE(nullptr, pProgram);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
pSource.reset();
|
||||
|
||||
retVal = clBuildProgram(
|
||||
pProgram,
|
||||
1,
|
||||
&testedClDevice,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
kernel = clCreateKernel(pProgram, "CopyBuffer", &retVal);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
retVal = clReleaseKernel(kernel);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clReleaseProgram(pProgram);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
delete kbHelper;
|
||||
BaseClass::TearDown();
|
||||
}
|
||||
|
||||
cl_program pProgram = nullptr;
|
||||
cl_kernel kernel = nullptr;
|
||||
KernelBinaryHelper *kbHelper;
|
||||
};
|
||||
|
||||
struct clGetKernelWorkGroupInfoTests : public clGetKernelWorkGroupInfoTest,
|
||||
public ::testing::WithParamInterface<uint32_t> {
|
||||
};
|
Reference in New Issue
Block a user