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

Which AT_DISPATCH... file should be used? #236

Open
unholdmx opened this issue Feb 20, 2024 · 0 comments
Open

Which AT_DISPATCH... file should be used? #236

unholdmx opened this issue Feb 20, 2024 · 0 comments

Comments

@unholdmx
Copy link

unholdmx commented Feb 20, 2024

I have a very hard time understanding, which AT_DISPATCH from here needs to be used in order to write tensors of different dtypes to a kernel.

While I understand, how #define AT_DISPATCH_FLOATING_TYPES(TYPE, NAME, ...) or #define AT_DISPATCH_INTEGRAL_TYPES(TYPE, NAME, ...) can be used when all tensors have the same dtype,
(here in a torch environment)

  AT_DISPATCH_FLOATING_TYPES(at::ScalarType::Float,"Some floating error message", [&] {
    some_cuda_kernel<scalar_t><<<blocks, threads>>>(
      some_float_tensor.packed_accessor<scalar_t,2,torch::RestrictPtrTraits,size_t>(),
     .... 
    );
    }
  );

all attempts to dispatch tensors when both tensors have different dtypes fail.

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

No branches or pull requests

1 participant