Skip to content

[STF] Rename places namespace from cuda::experimental::stf to cuda::experimental::places#8219

Merged
andralex merged 47 commits intoNVIDIA:mainfrom
caugonnet:stf_places_namespaces
Apr 2, 2026
Merged

[STF] Rename places namespace from cuda::experimental::stf to cuda::experimental::places#8219
andralex merged 47 commits intoNVIDIA:mainfrom
caugonnet:stf_places_namespaces

Conversation

@caugonnet
Copy link
Copy Markdown
Contributor

Move all __places/ headers from namespace cuda::experimental::stf to cuda::experimental::places. Each header imports needed stf utility types (pos4, dim4, cuda_safe_call, etc.) via using declarations and re-exports its public types back into cuda::experimental::stf for backward compat.

Hash specializations (stf::hash<data_place>, stf::hash<exec_place>, stf::hash<green_ctx_view>) remain in the stf namespace where the primary template is defined. The composite_slice cross-boundary function signature is updated to use the qualified places type.

Tests, examples, C API, and documentation are updated to use the new namespace.

Made-with: Cursor

Description

closes

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

…xperimental::places

Move all __places/ headers from namespace cuda::experimental::stf to
cuda::experimental::places. Each header imports needed stf utility types
(pos4, dim4, cuda_safe_call, etc.) via using declarations and re-exports
its public types back into cuda::experimental::stf for backward compat.

Hash specializations (stf::hash<data_place>, stf::hash<exec_place>,
stf::hash<green_ctx_view>) remain in the stf namespace where the primary
template is defined. The composite_slice cross-boundary function
signature is updated to use the qualified places type.

Tests, examples, C API, and documentation are updated to use the new
namespace.

Made-with: Cursor
@caugonnet caugonnet self-assigned this Mar 30, 2026
@caugonnet caugonnet added stf Sequential Task Flow programming model places labels Mar 30, 2026
@github-project-automation github-project-automation bot moved this to Todo in CCCL Mar 30, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Mar 30, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Progress in CCCL Mar 30, 2026
Move all stf namespace backward compatibility using-declarations
from individual __places/ headers into the central places.cuh
compat block. This makes places.cuh the single curated list of
places types re-exported into the stf namespace.

Made-with: Cursor
};
#endif // _CCCL_CTK_AT_LEAST(12, 4)

// Backward compatibility: re-export places types into the stf namespace
Copy link
Copy Markdown
Contributor Author

@caugonnet caugonnet Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to have a curated list ... and i hate this for now

The places API is part of the ``cuda::experimental::places`` C++ namespace
and can be used standalone via the ``cuda/experimental/places.cuh`` header,
without pulling in the full CUDASTF task-graph framework.
without pulling in the full CUDASTF task-graph framework. For backward
Copy link
Copy Markdown
Contributor Author

@caugonnet caugonnet Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be more specific about what exactly is made available

Remove non-user-visible types from the places.cuh backward compat
block and qualify them with places:: in the __stf/ files that use
them. Move instance_id_t to its own __stf/internal/instance_id.cuh
header since it conceptually belongs to the task framework, not
the places library.

The compat block now only re-exports user-facing types:
data_place, exec_place, exec_place_scope, decorated_stream,
make_grid, partition_cyclic, partition_tile, to_index, from_index,
device_ordinal.

Made-with: Cursor
Remove redundant using places::decorated_stream from stream_ctx.cuh
and remove place_partition backward compat block from
place_partition.cuh since loop_dispatch.cuh now uses places::
qualified names directly.

Made-with: Cursor
@caugonnet
Copy link
Copy Markdown
Contributor Author

/ok to test 9ac579c

@github-actions

This comment has been minimized.

Forward declarations like class exec_place inside namespace stf
conflict with the using places::exec_place from the compat block.
Remove redundant forward declarations where places.cuh is
transitively included, and for files without transitive inclusion,
forward-declare in namespace places and add a local using.

Made-with: Cursor
@caugonnet
Copy link
Copy Markdown
Contributor Author

/ok to test a55db1e

@github-actions

This comment has been minimized.

caugonnet and others added 3 commits March 31, 2026 08:56
Tests were using place_partition_scope, place_partition,
place_partition_scope_to_string, and make_grid unqualified via
`using namespace stf`, but these are no longer re-exported from
the stf namespace. Also rename local variable `places` in gc_grid.cu
to avoid shadowing the namespace.

Made-with: Cursor
@github-actions

This comment has been minimized.

Split partition-related usings into stf_places_partition_into_stf.cuh to avoid
include cycle with async_resources_handle. Extend stf_places_extended_exports
with localized_array, stream ids, hash keys, and machine.
@andralex
Copy link
Copy Markdown
Contributor

andralex commented Apr 2, 2026

/ok to test b3b4d1d

@github-actions

This comment has been minimized.

…APIs

Fix CI after partition usings moved out of stf.cuh umbrella.
@andralex
Copy link
Copy Markdown
Contributor

andralex commented Apr 2, 2026

/ok to test 79b3ded

@github-actions

This comment has been minimized.

- stf_places_into_stf_core: include places.cuh for isolated header tests
- stf_places_extended_exports: include hash.cuh so SortIncludes cannot break
  specialization order; drop redundant hash includes from callers
- composite_slice: extended + into_stf_core only (sorted order safe)
@andralex
Copy link
Copy Markdown
Contributor

andralex commented Apr 2, 2026

/ok to test 25d6260

@andralex andralex marked this pull request as ready for review April 2, 2026 05:32
@andralex andralex requested review from a team as code owners April 2, 2026 05:32
@andralex andralex enabled auto-merge (squash) April 2, 2026 05:32
@cccl-authenticator-app cccl-authenticator-app bot moved this from In Progress to In Review in CCCL Apr 2, 2026
Copy link
Copy Markdown
Contributor

@andralex andralex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More to come

@github-actions

This comment has been minimized.

@andralex
Copy link
Copy Markdown
Contributor

andralex commented Apr 2, 2026

/ok to test 25d6260

@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Apr 2, 2026

/ok to test 25d6260

@andralex, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@andralex
Copy link
Copy Markdown
Contributor

andralex commented Apr 2, 2026

/ok to test 88b034b

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🥳 CI Workflow Results

🟩 Finished in 57m 18s: Pass: 100%/52 | Total: 22h 13m | Max: 43m 35s | Hits: 59%/26965

See results here.

@andralex andralex merged commit 9832833 into NVIDIA:main Apr 2, 2026
72 of 74 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Apr 2, 2026
gonidelis pushed a commit to gonidelis/cccl that referenced this pull request Apr 8, 2026
…xperimental::places (NVIDIA#8219)

* [STF] Rename places namespace from cuda::experimental::stf to cuda::experimental::places

Move all __places/ headers from namespace cuda::experimental::stf to
cuda::experimental::places. Each header imports needed stf utility types
(pos4, dim4, cuda_safe_call, etc.) via using declarations and re-exports
its public types back into cuda::experimental::stf for backward compat.

Hash specializations (stf::hash<data_place>, stf::hash<exec_place>,
stf::hash<green_ctx_view>) remain in the stf namespace where the primary
template is defined. The composite_slice cross-boundary function
signature is updated to use the qualified places type.

Tests, examples, C API, and documentation are updated to use the new
namespace.

Made-with: Cursor

* remove some redundant using

* consolidate places backward compat into places.cuh

Move all stf namespace backward compatibility using-declarations
from individual __places/ headers into the central places.cuh
compat block. This makes places.cuh the single curated list of
places types re-exported into the stf namespace.

Made-with: Cursor

* qualify internal places types with places:: in __stf/ headers

Remove non-user-visible types from the places.cuh backward compat
block and qualify them with places:: in the __stf/ files that use
them. Move instance_id_t to its own __stf/internal/instance_id.cuh
header since it conceptually belongs to the task framework, not
the places library.

The compat block now only re-exports user-facing types:
data_place, exec_place, exec_place_scope, decorated_stream,
make_grid, partition_cyclic, partition_tile, to_index, from_index,
device_ordinal.

Made-with: Cursor

* remove make_grid from places backward compat block

Made-with: Cursor

* clang-format

* comments about a TODO

* qualify place_partition types with places:: in loop_dispatch.cuh

Remove redundant using places::decorated_stream from stream_ctx.cuh
and remove place_partition backward compat block from
place_partition.cuh since loop_dispatch.cuh now uses places::
qualified names directly.

Made-with: Cursor

* fix forward declarations of places types in stf headers

Forward declarations like class exec_place inside namespace stf
conflict with the using places::exec_place from the compat block.
Remove redundant forward declarations where places.cuh is
transitively included, and for files without transitive inclusion,
forward-declare in namespace places and add a local using.

Made-with: Cursor

* qualify places:: types in test files after compat block cleanup

Tests were using place_partition_scope, place_partition,
place_partition_scope_to_string, and make_grid unqualified via
`using namespace stf`, but these are no longer re-exported from
the stf namespace. Also rename local variable `places` in gc_grid.cu
to avoid shadowing the namespace.

Made-with: Cursor

* clang-format

* use 'using namespace places' in tests instead of explicit qualification

Replace `places::` qualifiers with `using namespace
cuda::experimental::places;` for consistency with the existing
`using namespace cuda::experimental::stf;` pattern in test files.

Made-with: Cursor

* disambiguate stf::reserved in C API after places namespace split

Both stf::reserved and places::reserved exist, so unqualified
'reserved::' is ambiguous when both namespaces are imported.

Made-with: Cursor

* remove green_context.cuh backward compat block

All 5 re-exported types (exec_place_green_ctx_impl,
get_cuda_context_id, green_context_helper,
green_ctx_data_place_impl, make_green_ctx_data_place) are either
internal-only or test-convenience types. Tests that use
green_context_helper now import cuda::experimental::places directly.

Made-with: Cursor

* remove unnecessary stf namespace import of exec_place_cuda_stream_impl

Made-with: Cursor

* remove unnecessary stf namespace imports from __places headers

Made-with: Cursor

* introduce independent places::hash template for places types

Define places::hash<T> as a standalone primary template with
specializations for data_place, exec_place, and green_ctx_view.
Update all stf code and tests to use places::hash for places types
instead of the former stf::hash specializations.

Made-with: Cursor

* use 'using namespace places' in test/example files instead of fully qualified places::hash

Made-with: Cursor

* clang-format

* move green_ctx_view hash specialization to green_ctx_view.cuh

Made-with: Cursor

* clang-format

* Fix places/STF namespace qualification in green context plumbing

- Use places::green_context_helper in async_resources_handle (class lives
  in cuda::experimental::places; fixes cudax.test.places builds).
- Qualify stf::mv and stf::hash_all in green_ctx_view.cuh; drop redundant
  using-declarations.

Made-with: Cursor

* Extra fixed for namespaces

* use properly qualified names

* Add missing using namespace in examples

* add missing namespace

* [STF] Disable stackable_loop_dispatch test

The test is hitting a double free or corruption (fasttop) at runtime.
Disabling it until the root cause is investigated.

Made-with: Cursor

* better message

* cudax: re-export places into STF from STF-only headers; remove using namespace places from STF tests

* cudax: fix STF places exports on CTK<12.4; extend places umbrella

* cudax: re-export cyclic_partition into stf; include cyclic_shape in places umbrella

* lookup fix

* cudax(places): use cuda_try consistently; cuda_try<fn> for unambiguous APIs; update places tests

* stf: export places names into stf; remove places:: call sites

Split partition-related usings into stf_places_partition_into_stf.cuh to avoid
include cycle with async_resources_handle. Extend stf_places_extended_exports
with localized_array, stream ids, hash keys, and machine.

* stf tests: include stf_places_partition_into_stf for place_partition APIs

Fix CI after partition usings moved out of stf.cuh umbrella.

* stf places bridges: self-contained headers, hash via extended_exports

- stf_places_into_stf_core: include places.cuh for isolated header tests
- stf_places_extended_exports: include hash.cuh so SortIncludes cannot break
  specialization order; drop redundant hash includes from callers
- composite_slice: extended + into_stf_core only (sorted order safe)

---------

Co-authored-by: Andrei Alexandrescu <andrei@erdani.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

places stf Sequential Task Flow programming model

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants