llnl / llnl/blt

create an example that tests both openmp and cuda

Open
#163 3 comments 0 reactions 0 assignees View on GitHub
task
Dominant language
C++
Stars
296
Forks
66
Avg merge
1h 3m
Merged PRs (30d)
1

Description

In `blt_add_lib`, we can't use

`DEPENDS_ON openmp cuda` b/c this will end up passing the openmp flags to nvcc.

But you can do the following:

`DEPENDS_ON cuda`

```
if(ENABLE_OPENMP)
if(CUDA_FOUND)
blt_add_target_compile_flags(TO my_target FLAGS "-Xcompiler ${OpenMP_CXX_FLAGS}")
else()
add_target_compile_flags(TO my_target FLAGS "${OpenMP_CXX_FLAGS}")
endif()
endif()
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing examples or tests around `blt_add_lib` and `blt_add_target_compile_flags`. Use the issue's OpenMP and CUDA setup as the acceptance case, and confirm the example builds with both enabled without passing OpenMP flags directly to `nvcc`.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.