Skip to content

Commit

Permalink
Add test executable and update CMakeLists to link against shared library
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed May 5, 2024
1 parent 9478ed5 commit 5fdd5a8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cuda_kernel_generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,17 @@ target_include_directories(cuda_kernel_generator PRIVATE
# Link CUDA libraries and the omnn/math library
target_link_libraries(cuda_kernel_generator
CUDA::cudart
omnn_math # Replace with the actual math library target name if different
/home/ubuntu/openmind/omnn/math/libstorage.a # Corrected the full path to the storage library
)

# Ensure shared libraries are used for the linker
set_property(TARGET cuda_kernel_generator PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)

# Explicitly set the standard include directories for the host compiler to ensure the correct headers are included
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/11;/usr/include/x86_64-linux-gnu/c++/11;/usr/include/c++/11/backward;/usr/lib/gcc/x86_64-linux-gnu/11/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")

# Add an executable for testing the shared library
add_executable(test_cuda_kernel_generator test_cuda_kernel_generator.cpp)

# Link the test executable with the shared library
target_link_libraries(test_cuda_kernel_generator cuda_kernel_generator)
14 changes: 14 additions & 0 deletions cuda_kernel_generator/test_cuda_kernel_generator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <iostream>

// Forward declaration of a function from the shared library
extern void generateCudaKernel();

int main() {
std::cout << "Testing the CUDA kernel generator shared library...\n";

// Call the function from the shared library
generateCudaKernel();

std::cout << "Test completed.\n";
return 0;
}

0 comments on commit 5fdd5a8

Please sign in to comment.