mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 08:19:02 +00:00
Merge vec_step and vec_align binaries into a new vectors binary (#926)
* Merge vec_step and vec_align binaries into a new vectors binary This change just merges the two suites to reuse common functions and definitions. There is probably room for further code consolidation but probably best done as a separate change. Contributes to #683 Signed-off-by: Kevin Petit <kevin.petit@arm.com> * format fixes
This commit is contained in:
75
test_conformance/vectors/structs.h
Normal file
75
test_conformance/vectors/structs.h
Normal file
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// Copyright (c) 2017 The Khronos Group Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
#include "testBase.h"
|
||||
|
||||
|
||||
#include "harness/conversions.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
|
||||
typedef struct _clState
|
||||
{
|
||||
cl_device_id m_device;
|
||||
cl_context m_context;
|
||||
cl_command_queue m_queue;
|
||||
|
||||
cl_program m_program;
|
||||
cl_kernel m_kernel;
|
||||
size_t m_numThreads;
|
||||
} clState;
|
||||
|
||||
clState* newClState(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue);
|
||||
clState* destroyClState(clState* pState);
|
||||
|
||||
int clStateMakeProgram(clState* pState, const char* prog,
|
||||
const char* kernelName);
|
||||
void clStateDestroyProgramAndKernel(clState* pState);
|
||||
|
||||
int runKernel(clState* pState, size_t numThreads);
|
||||
|
||||
typedef struct _bufferStruct
|
||||
{
|
||||
void* m_pIn;
|
||||
void* m_pOut;
|
||||
|
||||
cl_mem m_outBuffer;
|
||||
cl_mem m_inBuffer;
|
||||
|
||||
size_t m_bufSizeIn, m_bufSizeOut;
|
||||
|
||||
int m_bufferUploaded;
|
||||
} bufferStruct;
|
||||
|
||||
|
||||
bufferStruct* newBufferStruct(size_t inSize, size_t outSize, clState* pClState);
|
||||
|
||||
bufferStruct* destroyBufferStruct(bufferStruct* destroyMe, clState* pClState);
|
||||
|
||||
void initContents(bufferStruct* pBufferStruct, clState* pClState,
|
||||
size_t typeSize, size_t vecWidth);
|
||||
|
||||
int pushArgs(bufferStruct* pBufferStruct, clState* pClState);
|
||||
int retrieveResults(bufferStruct* pBufferStruct, clState* pClState);
|
||||
|
||||
int checkCorrectnessStep(bufferStruct* pBufferStruct, clState* pClState,
|
||||
size_t typeSize, size_t vecWidth);
|
||||
// vecSizeIdx indexes into g_arrVecAlignMasks, g_arrVecSizeNames
|
||||
// and g_arrVecSizes
|
||||
int checkCorrectnessAlign(bufferStruct* pBufferStruct, clState* pClState,
|
||||
size_t minAlign);
|
||||
|
||||
int checkPackedCorrectness(bufferStruct* pBufferStruct, clState* pClState,
|
||||
size_t totSize, size_t beforeSize);
|
||||
Reference in New Issue
Block a user