llvm icon indicating copy to clipboard operation
llvm copied to clipboard

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

Open JackAKirk opened this issue 1 year ago • 3 comments

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.

JackAKirk avatar Jun 25 '24 14:06 JackAKirk

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 avatar Jun 27 '24 11:06 JackAKirk

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.

JackAKirk avatar Jul 09 '24 09:07 JackAKirk

@Alcpz @joeatodd Any more reviews for this?

Thanks

JackAKirk avatar Jul 10 '24 17:07 JackAKirk

Closing this after further discussions offline

npmiller avatar Aug 29 '24 14:08 npmiller

@Alcpz is this OK now? Thanks

JackAKirk avatar Oct 09 '24 13:10 JackAKirk

@Alcpz is this OK now? Thanks

Yes. I agree with @joeatodd review. Accepting your changes, assuming that you will finalize addressing his suggestions. Sorry for missing this.

Alcpz avatar Oct 09 '24 14:10 Alcpz

@Alcpz is this OK now? Thanks

Yes. I agree with @joeatodd review. Accepting your changes, assuming that you will finalize addressing his suggestions. Sorry for missing this.

Yes, I've updated the formatting now, thanks.

JackAKirk avatar Oct 09 '24 14:10 JackAKirk

@intel/llvm-gatekeepers Please merge this.

Thanks

JackAKirk avatar Oct 09 '24 15:10 JackAKirk