This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.20) | |
project(find_thrust) | |
file(DOWNLOAD https://github.com/NVIDIA/thrust/archive/refs/tags/1.12.0.tar.gz | |
${CMAKE_CURRENT_BINARY_DIR}/thrust-1.12.tar.gz) | |
file(DOWNLOAD https://github.com/NVIDIA/cub/archive/refs/tags/1.12.0.tar.gz | |
${CMAKE_CURRENT_BINARY_DIR}/cub-1.12.tar.gz) | |
file(DOWNLOAD https://github.com/NVIDIA/thrust/archive/refs/tags/1.15.0.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build a simple vtk-m example | |
git clone --single-branch --branch experimental_hip_support https://gitlab.kitware.com/robertmaynard/vtk-m.git | |
# build just the bits of vtk-m that work with hip | |
cmake -S src/ -B build_hip/ \ | |
-DVTKm_ENABLE_KOKKOS=ON \ | |
-DCMAKE_PREFIX_PATH=<kokkos_install_dir> | |
# build a simple vtk-m example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.11.0 FATAL_ERROR) | |
project(Example) | |
cmake_policy(SET CMP0077 NEW) | |
set(OPT_LOCAL_VAR FALSE) | |
option(OPT_LOCAL_VAR "TEST_VAR" ON) | |
if(OPT_LOCAL_VAR) | |
message(STATUS "option failed to overwrite existing normal variable") | |
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
robert@forge:~/Work/spack$ git log -n1 | |
commit 73a70b33ae68d7b38d3c69cb198fb33e70a76b6b (HEAD -> get_cmake_from_github, github/get_cmake_from_github) | |
Author: Robert Maynard <[email protected]> | |
Date: Mon Dec 3 11:10:30 2018 -0500 | |
Download CMake sources from the Github releases | |
Now that CMake is providing CMake release artifacts on github, | |
we should prefer those as they have better download speeds and | |
uptime. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nvcc -std=c++11 -arch=sm_30 -c main.cu [works] | |
nvcc -std=c++11 -arch=sm_32 -c main.cu [works] | |
nvcc -std=c++11 -arch=sm_35 -c main.cu [works] | |
nvcc -std=c++11 -arch=sm_50 -c main.cu [works] | |
nvcc -std=c++11 -arch=sm_60 -c main.cu [works] | |
nvcc -std=c++11 -arch=sm_70 -c main.cu [works] | |
nvcc -std=c++11 -arch=sm_30 -dc main.cu [works] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/robert/Work/local_type/src/main.cu(50): warning: calling a __host__ function from a __host__ __device__ function is not allowed | |
detected during instantiation of "int64_t vtkm::copy_if(InputIterator, InputIterator, Stencil, OutputIterator, UnaryPredicate) [with InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<float>>, Stencil=thrust::detail::normal_iterator<thrust::device_ptr<uint8_t>>, OutputIterator=thrust::detail::normal_iterator<thrust::device_ptr<float>>, UnaryPredicate=InComplete]" | |
(73): here | |
/home/robert/Work/local_type/src/main.cu(70): warning: calling a __host__ function("thrust::device_vector<float, ::thrust::device_malloc_allocator<float> > ::device_vector") from a __host__ __device__ function("Task::operator () const") is not allowed | |
/home/robert/Work/local_type/src/main.cu(71): warning: calling a __host__ function("thrust::device_vector<unsigned char, ::thrust::device_malloc_allocator<unsigned char> > ::device_vector") from a __host__ __device__ function("Task: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (NOT DEFINED PROJ_INSTALL_INCLUDE_DIR) | |
set(PROJ_INSTALL_INCLUDE_DIR "include/vtkm-${PROJ_VERSION_MAJOR}.${PROJ_VERSION_MINOR}") | |
endif() | |
if (NOT DEFINED PROJ_INSTALL_CONFIG_DIR) | |
set(PROJ_INSTALL_CONFIG_DIR "lib/cmake/vtkm-${PROJ_VERSION_MAJOR}.${PROJ_VERSION_MINOR}") | |
endif() | |
if (NOT DEFINED PROJ_INSTALL_LIB_DIR) | |
set(PROJ_INSTALL_LIB_DIR "lib") | |
endif() | |
if (NOT DEFINED PROJ_INSTALL_BIN_DIR) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(add_to_list variable_name) | |
#variable_name holds the name of the variable that we need to set | |
#so ${variable} == name, ${${variable}} == contents of said variable | |
message(STATUS "adding to variable ${variable_name}") | |
set(srcs ) | |
foreach(source_file ${ARGN}) | |
list(APPEND srcs "${CMAKE_CURRENT_SOURCE_DIR}/${source_file}") | |
endforeach() | |
#Functions have local scope so we need to set the callers version of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_library(I INTERFACE) | |
add_library(IA STATIC impl1.cpp) | |
set_target_properties(IA PROPERTIES POSITION_INDEPENDENT_CODE ON) | |
add_library(IB STATIC impl2.cpp) | |
set(has_iface "$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() | |
{ | |
return 0; | |
} |
NewerOlder