Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ message(STATUS "Using CMake version ${CMAKE_VERSION}")
################################
# BLT
################################
set(BLT_CXX_STD c++17 CACHE STRING "")
set(BLT_CXX_STD c++20 CACHE STRING "")

if(("${BLT_CXX_STD}" STREQUAL "c++98") OR
("${BLT_CXX_STD}" STREQUAL "c++11") OR
("${BLT_CXX_STD}" STREQUAL "c++14"))
message(FATAL_ERROR "CHAI requires a minimum C++ standard of c++17. Please set BLT_CXX_STD appropriately.")
("${BLT_CXX_STD}" STREQUAL "c++14") OR
("${BLT_CXX_STD}" STREQUAL "c++17"))
message(FATAL_ERROR "CHAI requires a minimum C++ standard of c++20. Please set BLT_CXX_STD appropriately.")
endif()

if (NOT BLT_LOADED)
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/managed_ptr_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//////////////////////////////////////////////////////////////////////////////
#include "gtest/gtest.h"

#define CHAI_USE_VAR(x) static_cast<void>(x)

#define GPU_TEST(X, Y) \
static void gpu_test_##X##Y(); \
TEST(X, Y) { gpu_test_##X##Y(); } \
Expand Down Expand Up @@ -872,6 +874,8 @@ class ABase {
// Virtual function to manipulate an array of objects
CHAI_HOST_DEVICE virtual void setArrayValues(int size, int value) {
// Base implementation does nothing
CHAI_USE_VAR(size);
CHAI_USE_VAR(value);
}

CHAI_HOST_DEVICE virtual int getTypeID() const { return 0; }
Expand Down Expand Up @@ -919,6 +923,7 @@ TEST(managed_ptr, polymorphic_with_ManagedArray_unpacker)
// Use virtual function to modify array through the member pointer
const int base_value = 10;
forall( sequential(), 0, 1,[=](int i ) {
CHAI_USE_VAR(i);
poly_ptr->setArrayValues(size, base_value);
});

Expand Down