Skip to content
Snippets Groups Projects
Commit 81c308b1 authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Fixing warning

parent 5e04cb27
No related branches found
No related tags found
No related merge requests found
Pipeline #755 passed
...@@ -40,7 +40,7 @@ template<typename T> void test() ...@@ -40,7 +40,7 @@ template<typename T> void test()
for (size_t i = 0 ; i < mem.size() ; i++) for (size_t i = 0 ; i < mem.size() ; i++)
{ptr[i] = i;} {ptr[i] = i;}
mem.flush(); mem.hostToDevice();
//! [Allocate some memory and fill with data] //! [Allocate some memory and fill with data]
...@@ -79,9 +79,11 @@ template<typename T> void test() ...@@ -79,9 +79,11 @@ template<typename T> void test()
unsigned char * ptr = (unsigned char *)src.getPointer(); unsigned char * ptr = (unsigned char *)src.getPointer();
for (size_t i = 0 ; i < src.size() ; i++) for (size_t i = 0 ; i < src.size() ; i++)
ptr[i] = i; {ptr[i] = i;}
src.hostToDevice();
dst.copy(src); dst.copy(src);
dst.deviceToHost();
for (size_t i = 0 ; i < FIRST_ALLOCATION ; i++) for (size_t i = 0 ; i < FIRST_ALLOCATION ; i++)
{ {
...@@ -98,11 +100,11 @@ template<typename T> void test() ...@@ -98,11 +100,11 @@ template<typename T> void test()
unsigned char * ptr = (unsigned char *)src.getPointer(); unsigned char * ptr = (unsigned char *)src.getPointer();
for (size_t i = 0 ; i < src.size() ; i++) for (size_t i = 0 ; i < src.size() ; i++)
ptr[i] = i; {ptr[i] = i;}
src.flush();
src.hostToDevice();
T dst = src; T dst = src;
dst.deviceToHost();
unsigned char * ptr2 = (unsigned char *)dst.getPointer(); unsigned char * ptr2 = (unsigned char *)dst.getPointer();
...@@ -236,11 +238,7 @@ void copy_device_host_test() ...@@ -236,11 +238,7 @@ void copy_device_host_test()
mem1.allocate(300); mem1.allocate(300);
mem2.allocate(500); mem2.allocate(500);
if (mem1.isDeviceHostSame() == true) if (mem1.isDeviceHostSame() == false)
{
BOOST_REQUIRE_EQUAL(mem1.getPointer(),mem1.getDevicePointer());
}
else
{ {
BOOST_REQUIRE(mem1.getPointer() != mem2.getDevicePointer()); BOOST_REQUIRE(mem1.getPointer() != mem2.getDevicePointer());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment