Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Fix warnings and typos in samples and tests
Browse files Browse the repository at this point in the history
Various small fixes have been implemented in this commit, including:

* A comment that hadn't been updated to reflect 1.2.1 changes
* A sneaky extraneous semicolon
* some unused variables and using statements in tests
* and some unsigned/signed comparisons.
  • Loading branch information
DuncanMcBain committed Apr 3, 2018
1 parent cc2d59c commit 54ff261
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cmake/Modules/FindComputeCpp.cmake
Expand Up @@ -143,7 +143,7 @@ else()
endif()

# Obtain the ComputeCpp include directory
set(COMPUTECPP_INCLUDE_DIRECTORY ${COMPUTECPP_PACKAGE_ROOT_DIR}/include/)
set(COMPUTECPP_INCLUDE_DIRECTORY ${COMPUTECPP_PACKAGE_ROOT_DIR}/include)
if (NOT EXISTS ${COMPUTECPP_INCLUDE_DIRECTORY})
message(FATAL_ERROR "ComputeCpp includes - Not found!")
else()
Expand Down
4 changes: 2 additions & 2 deletions samples/smart-pointer/smart-pointer.cpp
Expand Up @@ -156,8 +156,8 @@ int main() {
}
}
/* Normally data is copied to the host when buffers are destroyed, which
* would happen here, but since a map_allocator and host_accessor were
* used in concert no data copy happens (i.e., it has already happened. */
* would happen here, but since `use_host_ptr` and a host accessor were
* used in concert no data copy happens (i.e., has *already* happened). */
}

return correct ? 0 : 1;
Expand Down
Expand Up @@ -79,7 +79,7 @@ void vector_add(buffer<dataT, 1>* a, buffer<dataT, 1>* b, buffer<dataT, 1>* c,

cgh.parallel_for(range<1>(count),
vector_add_kernel<dataT>(a_dev, b_dev, c_dev));
};
}

/* Using the code above, two vector additions are performed: one on ints,
* the other on floats. */
Expand Down
3 changes: 0 additions & 3 deletions tests/legacy-pointer/basic.cc
Expand Up @@ -32,9 +32,6 @@

#include "legacy-pointer/legacy_pointer.hpp"

using sycl_acc_target = cl::sycl::access::target;
const sycl_acc_target sycl_acc_host = sycl_acc_target::host_buffer;

using sycl_acc_mode = cl::sycl::access::mode;
const sycl_acc_mode sycl_acc_rw = sycl_acc_mode::read_write;

Expand Down
1 change: 0 additions & 1 deletion tests/legacy-pointer/offset.cc
Expand Up @@ -33,7 +33,6 @@
#include "legacy-pointer/legacy_pointer.hpp"

using sycl_acc_target = cl::sycl::access::target;
const sycl_acc_target sycl_acc_host = sycl_acc_target::host_buffer;
const sycl_acc_target sycl_acc_buffer = sycl_acc_target::global_buffer;

using sycl_acc_mode = cl::sycl::access::mode;
Expand Down
4 changes: 2 additions & 2 deletions tests/vptr/basic.cc
Expand Up @@ -277,7 +277,7 @@ TEST(pointer_mapper, multiple_alloc_free) {
{
int* ptrToFree = nullptr;

for (auto i = 0; i < numAllocations / 2; i++) {
for (auto i = 0u; i < numAllocations / 2; i++) {
int* current =
static_cast<int*>(SYCLmalloc(uniform_dist(e1) * sizeof(int), pMap));
// We choose a random pointer to free from the entire range
Expand All @@ -289,7 +289,7 @@ TEST(pointer_mapper, multiple_alloc_free) {
SYCLfree(ptrToFree, pMap);
ASSERT_EQ(pMap.count(), (numAllocations / 2) - 1);
int* ptrInBetween = static_cast<int*>(SYCLmalloc(50 * sizeof(int), pMap));
for (auto i = 0; i < numAllocations / 2; i++) {
for (auto i = 0u; i < numAllocations / 2; i++) {
int* current =
static_cast<int*>(SYCLmalloc(uniform_dist(e1) * sizeof(int), pMap));
// We choose a random pointer to free from the entire range
Expand Down
1 change: 0 additions & 1 deletion tests/vptr/offset.cc
Expand Up @@ -34,7 +34,6 @@
#include "vptr/virtual_ptr.hpp"

using sycl_acc_target = cl::sycl::access::target;
const sycl_acc_target sycl_acc_host = sycl_acc_target::host_buffer;
const sycl_acc_target sycl_acc_buffer = sycl_acc_target::global_buffer;

using sycl_acc_mode = cl::sycl::access::mode;
Expand Down
9 changes: 1 addition & 8 deletions tests/vptr/space.cc
Expand Up @@ -33,18 +33,11 @@
#include "vptr/pointer_alias.hpp"
#include "vptr/virtual_ptr.hpp"

using sycl_acc_target = cl::sycl::access::target;
const sycl_acc_target sycl_acc_host = sycl_acc_target::host_buffer;
const sycl_acc_target sycl_acc_buffer = sycl_acc_target::global_buffer;

using sycl_acc_mode = cl::sycl::access::mode;
const sycl_acc_mode sycl_acc_rw = sycl_acc_mode::read_write;

using namespace cl::sycl::codeplay;

using buffer_t = PointerMapper::buffer_t;

int n = 10000;
constexpr int n = 10000;
int startCount = 5;

TEST(space, add_only) {
Expand Down

0 comments on commit 54ff261

Please sign in to comment.