Skip to content
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

[SYCL][COMPAT][cuda] Add "ptr_to_integer" syclcompat functions. #14283

Open
wants to merge 11 commits into
base: sycl
Choose a base branch
from

Conversation

JackAKirk
Copy link
Contributor

@JackAKirk JackAKirk commented Jun 25, 2024

Add "ptr_to_integer" (generic address space to .shared) syclcompat functions.

These functions are commonly required in optimized libraries that use inline ptx. The standard naming convention of removing "__" from corresponding cuda builtins has been applied. See the readme and accompanying test-e2e for example usage.

These functions are commonly required in optimized libraries that use
inline ptx. The standard naming convention of removing "__" from
corresponding cuda builtins has been applied.

Signed-off-by: JackAKirk <[email protected]>
Signed-off-by: JackAKirk <[email protected]>
@JackAKirk JackAKirk requested a review from a team as a code owner June 25, 2024 14:26
Signed-off-by: JackAKirk <[email protected]>
@joeatodd joeatodd changed the title [syclcompat][cuda] Add "ptr_to_integer" syclcompat functions. [SYCL][COMPAT][cuda] Add "ptr_to_integer" syclcompat functions. Jun 26, 2024
sycl/include/syclcompat/memory.hpp Outdated Show resolved Hide resolved
sycl/include/syclcompat/memory.hpp Outdated Show resolved Hide resolved
sycl/doc/syclcompat/README.md Outdated Show resolved Hide resolved
sycl/doc/syclcompat/README.md Outdated Show resolved Hide resolved
sycl/doc/syclcompat/README.md Outdated Show resolved Hide resolved
ptx -> PTX
removed ptx doc link as requested.

Co-authored-by: Alberto Cabrera Pérez <[email protected]>
Copy link
Contributor

@joeatodd joeatodd left a comment

Choose a reason for hiding this comment

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

Since these functions do the same thing aside from casting to int/size_t, can we not implement them as a single templated function?

sycl/doc/syclcompat/README.md Outdated Show resolved Hide resolved
@JackAKirk
Copy link
Contributor Author

JackAKirk commented Jun 27, 2024

Since these functions do the same thing aside from casting to int/size_t, can we not implement them as a single templated function?

Uncertainty around this is the reason I put them in experimental. It's a bit messy since the cuda versions of these api require different cuda toolkit versions (10.1 for the uint32_t and 11 for size_t, I think), but this does not affect these syclcompat translated versions. I was just told to translate them in this way so that cutlass sycl path can have corresponding apis to cuda runtime path. I don't think I really have the context to make a decision beyond this. It is probably best to ask @aacostadiaz what is best.

@JackAKirk
Copy link
Contributor Author

Since these functions do the same thing aside from casting to int/size_t, can we not implement them as a single templated function?

@aacostadiaz wants them to be two separate functions, so I'll leave it as it is.

Signed-off-by: JackAKirk <[email protected]>
Signed-off-by: JackAKirk <[email protected]>
@JackAKirk
Copy link
Contributor Author

@Alcpz @joeatodd Any more reviews for this?

Thanks

Copy link
Contributor

@joeatodd joeatodd left a comment

Choose a reason for hiding this comment

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

As discussed offline, these should be a single function with a template parameter describing the return type.

@npmiller
Copy link
Contributor

Closing this after further discussions offline

@npmiller npmiller closed this Aug 29, 2024
Merge branch 'sycl' into cuda-nvvm_get_smem_pointer

Signed-off-by: JackAKirk <[email protected]>
A single templated function is preferred.

Signed-off-by: JackAKirk <[email protected]>
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.

4 participants