mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-26 08:49:02 +00:00
Migrate mem_host_flags suite to the new test registration framework (#2314)
Contributes to #2181 Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "procs.h"
|
#include "testBase.h"
|
||||||
#include "C_host_memory_block.h"
|
#include "C_host_memory_block.h"
|
||||||
|
|
||||||
#define TEST_VALUE 5
|
#define TEST_VALUE 5
|
||||||
|
|||||||
@@ -22,30 +22,17 @@
|
|||||||
#include <CL/cl.h>
|
#include <CL/cl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "procs.h"
|
|
||||||
#include "harness/testHarness.h"
|
#include "harness/testHarness.h"
|
||||||
|
#include "harness/imageHelpers.h"
|
||||||
|
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
test_definition test_list[] = {
|
|
||||||
ADD_TEST(mem_host_read_only_buffer),
|
|
||||||
ADD_TEST(mem_host_read_only_subbuffer),
|
|
||||||
ADD_TEST(mem_host_write_only_buffer),
|
|
||||||
ADD_TEST(mem_host_write_only_subbuffer),
|
|
||||||
ADD_TEST(mem_host_no_access_buffer),
|
|
||||||
ADD_TEST(mem_host_no_access_subbuffer),
|
|
||||||
ADD_TEST(mem_host_read_only_image),
|
|
||||||
ADD_TEST(mem_host_write_only_image),
|
|
||||||
ADD_TEST(mem_host_no_access_image),
|
|
||||||
};
|
|
||||||
|
|
||||||
const int test_num = ARRAY_SIZE(test_list);
|
|
||||||
|
|
||||||
int main(int argc, const char *argv[])
|
int main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
log_info("1st part, non gl-sharing objects...\n");
|
log_info("1st part, non gl-sharing objects...\n");
|
||||||
gTestRounding = true;
|
gTestRounding = true;
|
||||||
return runTestHarness(argc, argv, test_num, test_list, false, 0);
|
return runTestHarness(argc, argv, test_registry::getInstance().num_tests(),
|
||||||
|
test_registry::getInstance().definitions(), false, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,20 +20,18 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include "procs.h"
|
|
||||||
|
|
||||||
#include "checker_mem_host_read_only.hpp"
|
#include "checker_mem_host_read_only.hpp"
|
||||||
#include "checker_mem_host_write_only.hpp"
|
#include "checker_mem_host_write_only.hpp"
|
||||||
#include "checker_mem_host_no_access.hpp"
|
#include "checker_mem_host_no_access.hpp"
|
||||||
|
|
||||||
static int test_mem_host_read_only_buffer_RW(
|
static int test_mem_host_read_only_buffer_RW(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
||||||
{
|
{
|
||||||
log_info("%s\n", __FUNCTION__);
|
log_info("%s\n", __FUNCTION__);
|
||||||
cBuffer_check_mem_host_read_only<TEST_ELEMENT_TYPE> checker(deviceID,
|
cBuffer_check_mem_host_read_only<TEST_ELEMENT_TYPE> checker(device, context,
|
||||||
context, queue);
|
queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
cl_int err;
|
cl_int err;
|
||||||
@@ -55,14 +53,14 @@ static int test_mem_host_read_only_buffer_RW(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int test_mem_host_read_only_buffer_RW_Rect(
|
static int test_mem_host_read_only_buffer_RW_Rect(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
||||||
{
|
{
|
||||||
log_info("%s\n", __FUNCTION__);
|
log_info("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
cBuffer_check_mem_host_read_only<TEST_ELEMENT_TYPE> checker(deviceID,
|
cBuffer_check_mem_host_read_only<TEST_ELEMENT_TYPE> checker(device, context,
|
||||||
context, queue);
|
queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
cl_int err;
|
cl_int err;
|
||||||
@@ -84,14 +82,14 @@ static int test_mem_host_read_only_buffer_RW_Rect(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int test_mem_host_read_only_buffer_RW_Mapping(
|
static int test_mem_host_read_only_buffer_RW_Mapping(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
||||||
{
|
{
|
||||||
log_info("%s\n", __FUNCTION__);
|
log_info("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
cBuffer_check_mem_host_read_only<TEST_ELEMENT_TYPE> checker(deviceID,
|
cBuffer_check_mem_host_read_only<TEST_ELEMENT_TYPE> checker(device, context,
|
||||||
context, queue);
|
queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
cl_int err;
|
cl_int err;
|
||||||
@@ -112,8 +110,7 @@ static int test_mem_host_read_only_buffer_RW_Mapping(
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_mem_host_read_only_buffer(cl_device_id deviceID, cl_context context,
|
REGISTER_TEST(mem_host_read_only_buffer)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
cl_mem_flags buffer_mem_flags[2] = {
|
cl_mem_flags buffer_mem_flags[2] = {
|
||||||
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_READ_ONLY,
|
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_READ_ONLY,
|
||||||
@@ -128,17 +125,17 @@ int test_mem_host_read_only_buffer(cl_device_id deviceID, cl_context context,
|
|||||||
{
|
{
|
||||||
|
|
||||||
err = test_mem_host_read_only_buffer_RW(
|
err = test_mem_host_read_only_buffer_RW(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
device, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
||||||
_BUFFER);
|
_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_read_only_buffer_RW_Rect(
|
err = test_mem_host_read_only_buffer_RW_Rect(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
device, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
||||||
_BUFFER);
|
_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_read_only_buffer_RW_Mapping(
|
err = test_mem_host_read_only_buffer_RW_Mapping(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
device, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
||||||
_BUFFER);
|
_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
}
|
}
|
||||||
@@ -146,8 +143,7 @@ int test_mem_host_read_only_buffer(cl_device_id deviceID, cl_context context,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_mem_host_read_only_subbuffer(cl_device_id deviceID, cl_context context,
|
REGISTER_TEST(mem_host_read_only_subbuffer)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
cl_mem_flags parent_buffer_mem_flags[1] = { CL_MEM_READ_WRITE
|
cl_mem_flags parent_buffer_mem_flags[1] = { CL_MEM_READ_WRITE
|
||||||
| CL_MEM_USE_HOST_PTR
|
| CL_MEM_USE_HOST_PTR
|
||||||
@@ -169,17 +165,17 @@ int test_mem_host_read_only_subbuffer(cl_device_id deviceID, cl_context context,
|
|||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
err = test_mem_host_read_only_buffer_RW(
|
err = test_mem_host_read_only_buffer_RW(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_read_only_buffer_RW_Rect(
|
err = test_mem_host_read_only_buffer_RW_Rect(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_read_only_buffer_RW_Mapping(
|
err = test_mem_host_read_only_buffer_RW_Mapping(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
}
|
}
|
||||||
@@ -191,14 +187,14 @@ int test_mem_host_read_only_subbuffer(cl_device_id deviceID, cl_context context,
|
|||||||
//=============================== Write only
|
//=============================== Write only
|
||||||
|
|
||||||
static cl_int test_mem_host_write_only_buffer_RW(
|
static cl_int test_mem_host_write_only_buffer_RW(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
||||||
{
|
{
|
||||||
log_info("%s\n", __FUNCTION__);
|
log_info("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
cBuffer_check_mem_host_write_only<TEST_ELEMENT_TYPE> checker(
|
cBuffer_check_mem_host_write_only<TEST_ELEMENT_TYPE> checker(
|
||||||
deviceID, context, queue);
|
device, context, queue);
|
||||||
|
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
@@ -221,14 +217,14 @@ static cl_int test_mem_host_write_only_buffer_RW(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cl_int test_mem_host_write_only_buffer_RW_Rect(
|
static cl_int test_mem_host_write_only_buffer_RW_Rect(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
||||||
{
|
{
|
||||||
log_info("%s\n", __FUNCTION__);
|
log_info("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
cBuffer_check_mem_host_write_only<TEST_ELEMENT_TYPE> checker(
|
cBuffer_check_mem_host_write_only<TEST_ELEMENT_TYPE> checker(
|
||||||
deviceID, context, queue);
|
device, context, queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
cl_int err;
|
cl_int err;
|
||||||
@@ -250,14 +246,14 @@ static cl_int test_mem_host_write_only_buffer_RW_Rect(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cl_int test_mem_host_write_only_buffer_RW_Mapping(
|
static cl_int test_mem_host_write_only_buffer_RW_Mapping(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
||||||
{
|
{
|
||||||
log_info("%s\n", __FUNCTION__);
|
log_info("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
cBuffer_check_mem_host_write_only<TEST_ELEMENT_TYPE> checker(
|
cBuffer_check_mem_host_write_only<TEST_ELEMENT_TYPE> checker(
|
||||||
deviceID, context, queue);
|
device, context, queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
cl_int err;
|
cl_int err;
|
||||||
@@ -278,8 +274,7 @@ static cl_int test_mem_host_write_only_buffer_RW_Mapping(
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_mem_host_write_only_buffer(cl_device_id deviceID, cl_context context,
|
REGISTER_TEST(mem_host_write_only_buffer)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
cl_mem_flags buffer_mem_flags[2] = {
|
cl_mem_flags buffer_mem_flags[2] = {
|
||||||
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_WRITE_ONLY,
|
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_WRITE_ONLY,
|
||||||
@@ -293,17 +288,17 @@ int test_mem_host_write_only_buffer(cl_device_id deviceID, cl_context context,
|
|||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
err = test_mem_host_write_only_buffer_RW(
|
err = test_mem_host_write_only_buffer_RW(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
device, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
||||||
_BUFFER);
|
_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_write_only_buffer_RW_Rect(
|
err = test_mem_host_write_only_buffer_RW_Rect(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
device, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
||||||
_BUFFER);
|
_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_write_only_buffer_RW_Mapping(
|
err = test_mem_host_write_only_buffer_RW_Mapping(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
device, context, queue, blocking[i], buffer_mem_flags[k], 0,
|
||||||
_BUFFER);
|
_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
}
|
}
|
||||||
@@ -311,9 +306,7 @@ int test_mem_host_write_only_buffer(cl_device_id deviceID, cl_context context,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_mem_host_write_only_subbuffer(cl_device_id deviceID,
|
REGISTER_TEST(mem_host_write_only_subbuffer)
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
cl_mem_flags parent_buffer_mem_flags[1] = { CL_MEM_READ_WRITE
|
cl_mem_flags parent_buffer_mem_flags[1] = { CL_MEM_READ_WRITE
|
||||||
| CL_MEM_USE_HOST_PTR
|
| CL_MEM_USE_HOST_PTR
|
||||||
@@ -336,17 +329,17 @@ int test_mem_host_write_only_subbuffer(cl_device_id deviceID,
|
|||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
err = test_mem_host_write_only_buffer_RW(
|
err = test_mem_host_write_only_buffer_RW(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[m],
|
device, context, queue, blocking[i], buffer_mem_flags[m],
|
||||||
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_write_only_buffer_RW_Rect(
|
err = test_mem_host_write_only_buffer_RW_Rect(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[m],
|
device, context, queue, blocking[i], buffer_mem_flags[m],
|
||||||
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_write_only_buffer_RW_Mapping(
|
err = test_mem_host_write_only_buffer_RW_Mapping(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[m],
|
device, context, queue, blocking[i], buffer_mem_flags[m],
|
||||||
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
}
|
}
|
||||||
@@ -359,14 +352,14 @@ int test_mem_host_write_only_subbuffer(cl_device_id deviceID,
|
|||||||
//===================== NO ACCESS
|
//===================== NO ACCESS
|
||||||
|
|
||||||
static cl_int test_mem_host_no_access_buffer_RW(
|
static cl_int test_mem_host_no_access_buffer_RW(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
||||||
{
|
{
|
||||||
log_info("%s\n", __FUNCTION__);
|
log_info("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
cBuffer_check_mem_host_no_access<TEST_ELEMENT_TYPE> checker(deviceID,
|
cBuffer_check_mem_host_no_access<TEST_ELEMENT_TYPE> checker(device, context,
|
||||||
context, queue);
|
queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
|
|
||||||
@@ -389,14 +382,14 @@ static cl_int test_mem_host_no_access_buffer_RW(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cl_int test_mem_host_no_access_buffer_RW_Rect(
|
static cl_int test_mem_host_no_access_buffer_RW_Rect(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
||||||
{
|
{
|
||||||
log_info("%s\n", __FUNCTION__);
|
log_info("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
cBuffer_check_mem_host_no_access<TEST_ELEMENT_TYPE> checker(deviceID,
|
cBuffer_check_mem_host_no_access<TEST_ELEMENT_TYPE> checker(device, context,
|
||||||
context, queue);
|
queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
cl_int err;
|
cl_int err;
|
||||||
@@ -418,14 +411,14 @@ static cl_int test_mem_host_no_access_buffer_RW_Rect(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cl_int test_mem_host_no_access_buffer_RW_Mapping(
|
static cl_int test_mem_host_no_access_buffer_RW_Mapping(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
cl_mem_flags parent_buffer_flag, enum BUFFER_TYPE buffer_type)
|
||||||
{
|
{
|
||||||
log_info("%s\n", __FUNCTION__);
|
log_info("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
cBuffer_check_mem_host_no_access<TEST_ELEMENT_TYPE> checker(deviceID,
|
cBuffer_check_mem_host_no_access<TEST_ELEMENT_TYPE> checker(device, context,
|
||||||
context, queue);
|
queue);
|
||||||
|
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
@@ -447,8 +440,7 @@ static cl_int test_mem_host_no_access_buffer_RW_Mapping(
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_mem_host_no_access_buffer(cl_device_id deviceID, cl_context context,
|
REGISTER_TEST(mem_host_no_access_buffer)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
cl_mem_flags buffer_mem_flag[2] = {
|
cl_mem_flags buffer_mem_flag[2] = {
|
||||||
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS,
|
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS,
|
||||||
@@ -462,17 +454,17 @@ int test_mem_host_no_access_buffer(cl_device_id deviceID, cl_context context,
|
|||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
err = test_mem_host_no_access_buffer_RW(
|
err = test_mem_host_no_access_buffer_RW(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flag[k], 0,
|
device, context, queue, blocking[i], buffer_mem_flag[k], 0,
|
||||||
_BUFFER);
|
_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_no_access_buffer_RW_Rect(
|
err = test_mem_host_no_access_buffer_RW_Rect(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flag[k], 0,
|
device, context, queue, blocking[i], buffer_mem_flag[k], 0,
|
||||||
_BUFFER);
|
_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_no_access_buffer_RW_Mapping(
|
err = test_mem_host_no_access_buffer_RW_Mapping(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flag[k], 0,
|
device, context, queue, blocking[i], buffer_mem_flag[k], 0,
|
||||||
_BUFFER);
|
_BUFFER);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
}
|
}
|
||||||
@@ -480,8 +472,7 @@ int test_mem_host_no_access_buffer(cl_device_id deviceID, cl_context context,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_mem_host_no_access_subbuffer(cl_device_id deviceID, cl_context context,
|
REGISTER_TEST(mem_host_no_access_subbuffer)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
cl_mem_flags parent_buffer_mem_flags[3] = {
|
cl_mem_flags parent_buffer_mem_flags[3] = {
|
||||||
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS,
|
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS,
|
||||||
@@ -505,15 +496,15 @@ int test_mem_host_no_access_subbuffer(cl_device_id deviceID, cl_context context,
|
|||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
err += test_mem_host_no_access_buffer_RW(
|
err += test_mem_host_no_access_buffer_RW(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
||||||
|
|
||||||
err += test_mem_host_no_access_buffer_RW_Rect(
|
err += test_mem_host_no_access_buffer_RW_Rect(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
||||||
|
|
||||||
err += test_mem_host_no_access_buffer_RW_Mapping(
|
err += test_mem_host_no_access_buffer_RW_Mapping(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
parent_buffer_mem_flags[p], _Sub_BUFFER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,22 +20,20 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include "procs.h"
|
|
||||||
|
|
||||||
#include "checker_image_mem_host_read_only.hpp"
|
#include "checker_image_mem_host_read_only.hpp"
|
||||||
#include "checker_image_mem_host_no_access.hpp"
|
#include "checker_image_mem_host_no_access.hpp"
|
||||||
#include "checker_image_mem_host_write_only.hpp"
|
#include "checker_image_mem_host_write_only.hpp"
|
||||||
|
|
||||||
//======================================
|
//======================================
|
||||||
static cl_int test_mem_host_read_only_RW_Image(
|
static cl_int test_mem_host_read_only_RW_Image(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
||||||
{
|
{
|
||||||
log_info("%s ... \n ", __FUNCTION__);
|
log_info("%s ... \n ", __FUNCTION__);
|
||||||
cl_int err = CL_SUCCESS;
|
cl_int err = CL_SUCCESS;
|
||||||
|
|
||||||
cImage_check_mem_host_read_only<int> checker(deviceID, context, queue);
|
cImage_check_mem_host_read_only<int> checker(device, context, queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
|
|
||||||
@@ -58,14 +56,14 @@ static cl_int test_mem_host_read_only_RW_Image(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cl_int test_mem_host_read_only_RW_Image_Mapping(
|
static cl_int test_mem_host_read_only_RW_Image_Mapping(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
||||||
{
|
{
|
||||||
log_info("%s ... \n ", __FUNCTION__);
|
log_info("%s ... \n ", __FUNCTION__);
|
||||||
cl_int err = CL_SUCCESS;
|
cl_int err = CL_SUCCESS;
|
||||||
|
|
||||||
cImage_check_mem_host_read_only<int> checker(deviceID, context, queue);
|
cImage_check_mem_host_read_only<int> checker(device, context, queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
|
|
||||||
@@ -87,8 +85,7 @@ static cl_int test_mem_host_read_only_RW_Image_Mapping(
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_mem_host_read_only_image(cl_device_id deviceID, cl_context context,
|
REGISTER_TEST(mem_host_read_only_image)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
cl_mem_flags buffer_mem_flags[2] = {
|
cl_mem_flags buffer_mem_flags[2] = {
|
||||||
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_READ_ONLY,
|
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_READ_ONLY,
|
||||||
@@ -98,8 +95,8 @@ int test_mem_host_read_only_image(cl_device_id deviceID, cl_context context,
|
|||||||
cl_int err = CL_SUCCESS;
|
cl_int err = CL_SUCCESS;
|
||||||
|
|
||||||
cl_bool image_support;
|
cl_bool image_support;
|
||||||
err = clGetDeviceInfo(deviceID, CL_DEVICE_IMAGE_SUPPORT,
|
err = clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, sizeof image_support,
|
||||||
sizeof image_support, &image_support, NULL);
|
&image_support, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
@@ -132,16 +129,14 @@ int test_mem_host_read_only_image(cl_device_id deviceID, cl_context context,
|
|||||||
for (int p = 0; p < 3; p++)
|
for (int p = 0; p < 3; p++)
|
||||||
{
|
{
|
||||||
err = test_mem_host_read_only_RW_Image(
|
err = test_mem_host_read_only_RW_Image(
|
||||||
deviceID, context, queue, blocking[i],
|
device, context, queue, blocking[i], buffer_mem_flags[flag],
|
||||||
buffer_mem_flags[flag], img_type[p], array_size[p],
|
img_type[p], array_size[p], img_dims[p]);
|
||||||
img_dims[p]);
|
|
||||||
|
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_mem_host_read_only_RW_Image_Mapping(
|
err = test_mem_host_read_only_RW_Image_Mapping(
|
||||||
deviceID, context, queue, blocking[i],
|
device, context, queue, blocking[i], buffer_mem_flags[flag],
|
||||||
buffer_mem_flags[flag], img_type[p], array_size[p],
|
img_type[p], array_size[p], img_dims[p]);
|
||||||
img_dims[p]);
|
|
||||||
|
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
}
|
}
|
||||||
@@ -152,14 +147,14 @@ int test_mem_host_read_only_image(cl_device_id deviceID, cl_context context,
|
|||||||
|
|
||||||
//----------------------------
|
//----------------------------
|
||||||
static cl_int test_MEM_HOST_WRITE_ONLY_Image_RW(
|
static cl_int test_MEM_HOST_WRITE_ONLY_Image_RW(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
||||||
{
|
{
|
||||||
log_info(" %s ... \n ", __FUNCTION__);
|
log_info(" %s ... \n ", __FUNCTION__);
|
||||||
cl_int err = CL_SUCCESS;
|
cl_int err = CL_SUCCESS;
|
||||||
|
|
||||||
cImage_check_mem_host_write_only<int> checker(deviceID, context, queue);
|
cImage_check_mem_host_write_only<int> checker(device, context, queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
|
|
||||||
@@ -185,14 +180,14 @@ static cl_int test_MEM_HOST_WRITE_ONLY_Image_RW(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cl_int test_MEM_HOST_WRITE_ONLY_Image_RW_Mapping(
|
static cl_int test_MEM_HOST_WRITE_ONLY_Image_RW_Mapping(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
||||||
{
|
{
|
||||||
log_info("%s ... \n ", __FUNCTION__);
|
log_info("%s ... \n ", __FUNCTION__);
|
||||||
cl_int err = CL_SUCCESS;
|
cl_int err = CL_SUCCESS;
|
||||||
|
|
||||||
cImage_check_mem_host_write_only<int> checker(deviceID, context, queue);
|
cImage_check_mem_host_write_only<int> checker(device, context, queue);
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
|
|
||||||
@@ -217,8 +212,7 @@ static cl_int test_MEM_HOST_WRITE_ONLY_Image_RW_Mapping(
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_mem_host_write_only_image(cl_device_id deviceID, cl_context context,
|
REGISTER_TEST(mem_host_write_only_image)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
cl_mem_flags buffer_mem_flags[2] = {
|
cl_mem_flags buffer_mem_flags[2] = {
|
||||||
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_WRITE_ONLY,
|
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_WRITE_ONLY,
|
||||||
@@ -228,8 +222,8 @@ int test_mem_host_write_only_image(cl_device_id deviceID, cl_context context,
|
|||||||
cl_int err = CL_SUCCESS;
|
cl_int err = CL_SUCCESS;
|
||||||
|
|
||||||
cl_bool image_support;
|
cl_bool image_support;
|
||||||
err = clGetDeviceInfo(deviceID, CL_DEVICE_IMAGE_SUPPORT,
|
err = clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, sizeof image_support,
|
||||||
sizeof image_support, &image_support, NULL);
|
&image_support, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
@@ -261,12 +255,12 @@ int test_mem_host_write_only_image(cl_device_id deviceID, cl_context context,
|
|||||||
for (int p = 0; p < 3; p++)
|
for (int p = 0; p < 3; p++)
|
||||||
{
|
{
|
||||||
err = test_MEM_HOST_WRITE_ONLY_Image_RW(
|
err = test_MEM_HOST_WRITE_ONLY_Image_RW(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
img_type[p], array_size[p], img_dims[p]);
|
img_type[p], array_size[p], img_dims[p]);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
|
|
||||||
err = test_MEM_HOST_WRITE_ONLY_Image_RW_Mapping(
|
err = test_MEM_HOST_WRITE_ONLY_Image_RW_Mapping(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
img_type[p], array_size[p], img_dims[p]);
|
img_type[p], array_size[p], img_dims[p]);
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
}
|
}
|
||||||
@@ -278,14 +272,14 @@ int test_mem_host_write_only_image(cl_device_id deviceID, cl_context context,
|
|||||||
//--------
|
//--------
|
||||||
|
|
||||||
static cl_int test_mem_host_no_access_Image_RW(
|
static cl_int test_mem_host_no_access_Image_RW(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
||||||
{
|
{
|
||||||
log_info("%s ... \n", __FUNCTION__);
|
log_info("%s ... \n", __FUNCTION__);
|
||||||
cl_int err = CL_SUCCESS;
|
cl_int err = CL_SUCCESS;
|
||||||
|
|
||||||
cImage_check_mem_host_no_access<int> checker(deviceID, context, queue);
|
cImage_check_mem_host_no_access<int> checker(device, context, queue);
|
||||||
|
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
@@ -310,14 +304,14 @@ static cl_int test_mem_host_no_access_Image_RW(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cl_int test_mem_host_no_access_Image_RW_Mapping(
|
static cl_int test_mem_host_no_access_Image_RW_Mapping(
|
||||||
cl_device_id deviceID, cl_context context, cl_command_queue queue,
|
cl_device_id device, cl_context context, cl_command_queue queue,
|
||||||
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
cl_bool blocking, cl_mem_flags buffer_mem_flag,
|
||||||
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
cl_mem_object_type image_type_in, size_t array_size, size_t *img_dim)
|
||||||
{
|
{
|
||||||
log_info("%s ... \n ", __FUNCTION__);
|
log_info("%s ... \n ", __FUNCTION__);
|
||||||
cl_int err = CL_SUCCESS;
|
cl_int err = CL_SUCCESS;
|
||||||
|
|
||||||
cImage_check_mem_host_no_access<int> checker(deviceID, context, queue);
|
cImage_check_mem_host_no_access<int> checker(device, context, queue);
|
||||||
|
|
||||||
checker.m_blocking = blocking;
|
checker.m_blocking = blocking;
|
||||||
checker.buffer_mem_flag = buffer_mem_flag;
|
checker.buffer_mem_flag = buffer_mem_flag;
|
||||||
@@ -341,8 +335,7 @@ static cl_int test_mem_host_no_access_Image_RW_Mapping(
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_mem_host_no_access_image(cl_device_id deviceID, cl_context context,
|
REGISTER_TEST(mem_host_no_access_image)
|
||||||
cl_command_queue queue, int num_elements)
|
|
||||||
{
|
{
|
||||||
cl_mem_flags buffer_mem_flags[2] = {
|
cl_mem_flags buffer_mem_flags[2] = {
|
||||||
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS,
|
CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS,
|
||||||
@@ -352,8 +345,8 @@ int test_mem_host_no_access_image(cl_device_id deviceID, cl_context context,
|
|||||||
cl_int err = CL_SUCCESS;
|
cl_int err = CL_SUCCESS;
|
||||||
|
|
||||||
cl_bool image_support;
|
cl_bool image_support;
|
||||||
err = clGetDeviceInfo(deviceID, CL_DEVICE_IMAGE_SUPPORT,
|
err = clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, sizeof image_support,
|
||||||
sizeof image_support, &image_support, NULL);
|
&image_support, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
test_error(err, __FUNCTION__);
|
test_error(err, __FUNCTION__);
|
||||||
@@ -385,11 +378,11 @@ int test_mem_host_no_access_image(cl_device_id deviceID, cl_context context,
|
|||||||
for (int p = 0; p < 3; p++)
|
for (int p = 0; p < 3; p++)
|
||||||
{
|
{
|
||||||
err += test_mem_host_no_access_Image_RW(
|
err += test_mem_host_no_access_Image_RW(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
img_type[p], array_size[p], img_dims[p]);
|
img_type[p], array_size[p], img_dims[p]);
|
||||||
|
|
||||||
err += test_mem_host_no_access_Image_RW_Mapping(
|
err += test_mem_host_no_access_Image_RW_Mapping(
|
||||||
deviceID, context, queue, blocking[i], buffer_mem_flags[k],
|
device, context, queue, blocking[i], buffer_mem_flags[k],
|
||||||
img_type[p], array_size[p], img_dims[p]);
|
img_type[p], array_size[p], img_dims[p]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
//
|
|
||||||
// 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.
|
|
||||||
//
|
|
||||||
#ifndef __PROCS_H__
|
|
||||||
#define __PROCS_H__
|
|
||||||
|
|
||||||
#include "testBase.h"
|
|
||||||
|
|
||||||
#define NUM_FLAGS 4
|
|
||||||
|
|
||||||
extern int test_mem_host_read_only_buffer(cl_device_id deviceID,
|
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue,
|
|
||||||
int num_elements);
|
|
||||||
extern int test_mem_host_read_only_subbuffer(cl_device_id deviceID,
|
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue,
|
|
||||||
int num_elements);
|
|
||||||
|
|
||||||
extern int test_mem_host_write_only_buffer(cl_device_id deviceID,
|
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue,
|
|
||||||
int num_elements);
|
|
||||||
extern int test_mem_host_write_only_subbuffer(cl_device_id deviceID,
|
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue,
|
|
||||||
int num_elements);
|
|
||||||
|
|
||||||
extern int test_mem_host_no_access_buffer(cl_device_id deviceID,
|
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue,
|
|
||||||
int num_elements);
|
|
||||||
extern int test_mem_host_no_access_subbuffer(cl_device_id deviceID,
|
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue,
|
|
||||||
int num_elements);
|
|
||||||
|
|
||||||
extern int test_mem_host_read_only_image(cl_device_id deviceID,
|
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue,
|
|
||||||
int num_elements);
|
|
||||||
extern int test_mem_host_write_only_image(cl_device_id deviceID,
|
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue,
|
|
||||||
int num_elements);
|
|
||||||
extern int test_mem_host_no_access_image(cl_device_id deviceID,
|
|
||||||
cl_context context,
|
|
||||||
cl_command_queue queue,
|
|
||||||
int num_elements);
|
|
||||||
|
|
||||||
#endif // #ifndef __PROCS_H__
|
|
||||||
Reference in New Issue
Block a user