Skip to content

Making CudaGraph-constructor SFINAE with requires - #803

Merged
tsung-wei-huang merged 1 commit into
taskflow:masterfrom
fior512:cudaGraph_constructor_SFINAE
Jul 28, 2026
Merged

Making CudaGraph-constructor SFINAE with requires#803
tsung-wei-huang merged 1 commit into
taskflow:masterfrom
fior512:cudaGraph_constructor_SFINAE

Conversation

@fior512

@fior512 fior512 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #753, with requires std::is_invocable_r_v<...> for SFINAE friendly behavior of CudaGraphBase inside taskflow/cuda/cuda_graph.hpp:550

Tests

Replicated with:

static_assert(!std::constructible_from<cudaGraph, std::string>, "bug: cudaGraph should not be constructible with std::string");

with master branch (cudagraph_i753.cpp is a local file for test):

cudagraph_i753.cpp:10:17: error: static assertion failed: bug: cudaGraph should not be constructible from std::string
   10 |   static_assert(!std::constructible_from<cudaGraph, std::string>, "bug: cudaGraph should not be constructible with std::string");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

with this PR: fixed.

Notes

@fior512 fior512 changed the title SFINAE issue753 cudagraph_t Making CudaGraph-constructor SFINAE with requires Jul 20, 2026
@tsung-wei-huang
tsung-wei-huang merged commit c4da2a4 into taskflow:master Jul 28, 2026
@tsung-wei-huang

Copy link
Copy Markdown
Member

Excellent pull! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cudaGraph constructor is not SFINAE-friendly

2 participants