mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-26 08:49:02 +00:00
A few error handling and flag test fixes for mem_host_flags (#484)
- Add missing error checks - Add missing return - Fix flag check Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
@@ -51,6 +51,7 @@ cl_int cImage_check_mem_host_no_access<T>:: verify_RW_Image()
|
|||||||
&color,
|
&color,
|
||||||
img_orig, img_region,
|
img_orig, img_region,
|
||||||
0, NULL, &event);
|
0, NULL, &event);
|
||||||
|
test_error(err, "clEnqueueFillImage error");
|
||||||
|
|
||||||
if (!this->m_blocking) {
|
if (!this->m_blocking) {
|
||||||
err = clWaitForEvents(1, &event);
|
err = clWaitForEvents(1, &event);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ cl_int cBuffer_check_mem_host_read_only< T >::SetupBuffer()
|
|||||||
block_size_in_byte, this->host_m_1.pData, &err);
|
block_size_in_byte, this->host_m_1.pData, &err);
|
||||||
test_error(err, "clCreateBuffer error");
|
test_error(err, "clCreateBuffer error");
|
||||||
|
|
||||||
if (this->buffer_mem_flag | CL_MEM_USE_HOST_PTR)
|
if (this->buffer_mem_flag & CL_MEM_USE_HOST_PTR)
|
||||||
{
|
{
|
||||||
this->pHost_ptr = (void *)this->host_m_1.pData;
|
this->pHost_ptr = (void *)this->host_m_1.pData;
|
||||||
}
|
}
|
||||||
@@ -235,6 +235,7 @@ cl_int cBuffer_check_mem_host_read_only< T >::verify_RW_Buffer_mapping()
|
|||||||
|
|
||||||
if ((this->buffer_mem_flag & CL_MEM_USE_HOST_PTR) && dataPtr != this->pHost_ptr ) {
|
if ((this->buffer_mem_flag & CL_MEM_USE_HOST_PTR) && dataPtr != this->pHost_ptr ) {
|
||||||
log_error("Mapped host pointer difference found\n");
|
log_error("Mapped host pointer difference found\n");
|
||||||
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this->host_m_1.Equal((T*)dataPtr, this->m_nNumber_elements)) {
|
if(!this->host_m_1.Equal((T*)dataPtr, this->m_nNumber_elements)) {
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ cl_int cBuffer_check_mem_host_write_only< T >::verify_RW_Buffer_rect()
|
|||||||
err = clEnqueueWriteBuffer(this->m_queue, this->m_buffer, CL_TRUE, 0,
|
err = clEnqueueWriteBuffer(this->m_queue, this->m_buffer, CL_TRUE, 0,
|
||||||
this->get_block_size_bytes(), tmp_host_m.pData,
|
this->get_block_size_bytes(), tmp_host_m.pData,
|
||||||
0, NULL, &event_1);
|
0, NULL, &event_1);
|
||||||
|
test_error(err, "clEnqueueWriteBuffer error");
|
||||||
|
|
||||||
vv1 = TEST_VALUE;
|
vv1 = TEST_VALUE;
|
||||||
tmp_host_m.Set_to(vv1);
|
tmp_host_m.Set_to(vv1);
|
||||||
@@ -205,7 +206,7 @@ cl_int cBuffer_check_mem_host_write_only< T >::verify_RW_Buffer_rect()
|
|||||||
this->host_slice_pitch_bytes,
|
this->host_slice_pitch_bytes,
|
||||||
tmp_host_m.pData,
|
tmp_host_m.pData,
|
||||||
1, &event_1, &event);
|
1, &event_1, &event);
|
||||||
test_error(err, "clEnqueueWriteBuffer error");
|
test_error(err, "clEnqueueWriteBufferRect error");
|
||||||
|
|
||||||
if (!this->m_blocking) {
|
if (!this->m_blocking) {
|
||||||
err = clWaitForEvents(1, &event);
|
err = clWaitForEvents(1, &event);
|
||||||
@@ -265,6 +266,7 @@ cl_int cBuffer_check_mem_host_write_only< T >::update_host_mem_2()
|
|||||||
cl_event event, event_2;
|
cl_event event, event_2;
|
||||||
cl_int err = clEnqueueCopyBuffer(this->m_queue, this->m_buffer, this->m_buffer2, 0, 0,
|
cl_int err = clEnqueueCopyBuffer(this->m_queue, this->m_buffer, this->m_buffer2, 0, 0,
|
||||||
this->m_nNumber_elements* sizeof (T), 0, NULL, &event);
|
this->m_nNumber_elements* sizeof (T), 0, NULL, &event);
|
||||||
|
test_error(err, "clEnqueueCopyBuffer error");
|
||||||
|
|
||||||
this->host_m_2.Set_to_zero();
|
this->host_m_2.Set_to_zero();
|
||||||
err = clEnqueueReadBuffer(this->m_queue, this->m_buffer2, CL_TRUE, 0,
|
err = clEnqueueReadBuffer(this->m_queue, this->m_buffer2, CL_TRUE, 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user