Repository navigation
Add transform c parallel implementation #4048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
shwina
merged 12 commits into
NVIDIA:main
from
shwina:add-transform-c-parallel-implementation
Mar 24, 2025
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6f67a00
Enable setting _CUB_HAS_TRANSFORM_UBLKCP as flag
shwina 316913c
Stale comment
shwina c04db0d
Update make_kernel_user_binary_operator to accept lhs/rhs types
shwina 9567b83
Add transform c.parallel implementation
shwina e659396
Add tests for c.parallel transform
shwina b1b0a09
Use launcher factory to query ptx version
shwina 6eb5e53
Refactor how we get iterator names
shwina 0754ba0
Add comment explaining why we need -default-device
shwina 0336e33
Address remaining review feedback
shwina 3a7bfae
Undo change to make_iterator_kernel_arg
shwina 997d005
Restore the comment
shwina 65cdd50
Restore comment
shwina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of CUDA Experimental in CUDA Core Compute Libraries, | ||
| // under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #pragma once | ||
|
|
||
| #ifndef CCCL_C_EXPERIMENTAL | ||
| # error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice." | ||
| #endif // !CCCL_C_EXPERIMENTAL | ||
|
|
||
| #include <cuda.h> | ||
|
|
||
| #include <cccl/c/extern_c.h> | ||
| #include <cccl/c/types.h> | ||
|
|
||
| CCCL_C_EXTERN_C_BEGIN | ||
|
|
||
| typedef struct cccl_device_transform_build_result_t | ||
| { | ||
| int cc; | ||
| void* cubin; | ||
| size_t cubin_size; | ||
| CUlibrary library; | ||
| CUkernel transform_kernel; | ||
| int loaded_bytes_per_iteration; | ||
| } cccl_device_transform_build_result_t; | ||
|
|
||
| CCCL_C_API CUresult cccl_device_unary_transform_build( | ||
| cccl_device_transform_build_result_t* build_ptr, | ||
| cccl_iterator_t d_in, | ||
| cccl_iterator_t d_out, | ||
| cccl_op_t op, | ||
| int cc_major, | ||
| int cc_minor, | ||
| const char* cub_path, | ||
| const char* thrust_path, | ||
| const char* libcudacxx_path, | ||
| const char* ctk_path); | ||
|
|
||
| CCCL_C_API CUresult cccl_device_unary_transform( | ||
| cccl_device_transform_build_result_t build, | ||
| cccl_iterator_t d_in, | ||
| cccl_iterator_t d_out, | ||
| unsigned long long num_items, | ||
| cccl_op_t op, | ||
| CUstream stream); | ||
|
|
||
| CCCL_C_API CUresult cccl_device_binary_transform_build( | ||
| cccl_device_transform_build_result_t* build_ptr, | ||
| cccl_iterator_t d_in1, | ||
| cccl_iterator_t d_in2, | ||
| cccl_iterator_t d_out, | ||
| cccl_op_t op, | ||
| int cc_major, | ||
| int cc_minor, | ||
| const char* cub_path, | ||
| const char* thrust_path, | ||
| const char* libcudacxx_path, | ||
| const char* ctk_path); | ||
|
|
||
| CCCL_C_API CUresult cccl_device_binary_transform( | ||
| cccl_device_transform_build_result_t build, | ||
| cccl_iterator_t d_in1, | ||
| cccl_iterator_t d_in2, | ||
| cccl_iterator_t d_out, | ||
| unsigned long long num_items, | ||
| cccl_op_t op, | ||
| CUstream stream); | ||
|
|
||
| CCCL_C_API CUresult cccl_device_transform_cleanup(cccl_device_transform_build_result_t* bld_ptr); | ||
|
|
||
| CCCL_C_EXTERN_C_END | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of
loaded_bytes_per_iterationin CUB isint- should I still make this change?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested this because you initialize it with
input_it.value_type.size, which is of typesize_t. But if CUB expects it to be anint, then I think you should keep it as is