add cuda
This commit is contained in:
52
rin/miner/gpu/RinHash-cuda/CMakeLists.txt
Normal file
52
rin/miner/gpu/RinHash-cuda/CMakeLists.txt
Normal file
@@ -0,0 +1,52 @@
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
project(RinHashCUDA LANGUAGES CXX CUDA)
|
||||
|
||||
# Set C++ standard
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CUDA_STANDARD 11)
|
||||
|
||||
# Find CUDA
|
||||
find_package(CUDA REQUIRED)
|
||||
|
||||
# Set CUDA architectures
|
||||
set(CMAKE_CUDA_ARCHITECTURES "50;52;60;61;70;75;80;86")
|
||||
|
||||
# Include directories
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# Source files
|
||||
set(CUDA_SOURCES
|
||||
rinhash.cu
|
||||
sha3-256.cu
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
rinhash_device.cuh
|
||||
argon2d_device.cuh
|
||||
blake3_device.cuh
|
||||
blaze3_cpu.cuh
|
||||
)
|
||||
|
||||
# Create executable
|
||||
add_executable(rinhash-cuda-miner ${CUDA_SOURCES} ${HEADERS})
|
||||
|
||||
# Set CUDA properties
|
||||
set_target_properties(rinhash-cuda-miner PROPERTIES
|
||||
CUDA_RUNTIME_LIBRARY Shared
|
||||
)
|
||||
|
||||
# Link CUDA libraries
|
||||
target_link_libraries(rinhash-cuda-miner
|
||||
${CUDA_LIBRARIES}
|
||||
${CUDA_CUDART_LIBRARY}
|
||||
)
|
||||
|
||||
# Compiler-specific options
|
||||
if(MSVC)
|
||||
target_compile_options(rinhash-cuda-miner PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-O3>)
|
||||
else()
|
||||
target_compile_options(rinhash-cuda-miner PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-O3>)
|
||||
endif()
|
||||
|
||||
# Install target
|
||||
install(TARGETS rinhash-cuda-miner DESTINATION bin)
|
Reference in New Issue
Block a user