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

Kokkos execution spaces API review #7511

Closed
masterleinad opened this issue Nov 4, 2024 · 0 comments
Closed

Kokkos execution spaces API review #7511

masterleinad opened this issue Nov 4, 2024 · 0 comments

Comments

@masterleinad
Copy link
Contributor

masterleinad commented Nov 4, 2024

Part of #7319. See kokkos/kokkos-core-wiki#581, https://kokkos.org/kokkos-core-wiki/API/core/KokkosConcepts.html?highlight=concepts#the-executionspace-concept, and https://kokkos.org/kokkos-core-wiki/API/core/execution_spaces.html#synopsis.

// This is not an actual class, it just describes the concept in shorthand
class ExecutionSpaceConcept {
public:
    typedef ExecutionSpaceConcept execution_space;
    typedef ... memory_space;
    typedef Device<execution_space, memory_space> device_type;
    typedef ... scratch_memory_space;
    typedef ... array_layout;
    typedef ... size_type;

    ExecutionSpaceConcept();
    ExecutionSpaceConcept(const ExecutionSpaceConcept& src);

    const char* name() const;
    void print_configuration(std::ostream ostr&) const;
    void print_configuration(std::ostream ostr&, bool details) const;

    int concurrency() const;

    void fence(const std::string&) const;
    void fence() const;

    friend bool operator==(const execution_space& lhs, const execution_space& rhs);
    friend bool operator!=(const execution_space& lhs, const execution_space& rhs);
};

template<class MS>
struct is_execution_space {
enum { value = false };
};

template<>
struct is_execution_space<ExecutionSpaceConcept> {
enum { value = true };
};

Backend-specific members:

Serial::Serial(NewInstance)
OpenMP::OpenMP(int pool_size)
HPX::HPX(hpx::execution::experimental::unique_any_sender<> &&sender)
HPX::get_sender()
Cuda::Cuda(cudaStream_t stream)
Cuda::cuda_stream()
Cuda::cuda_device()
Cuda::cuda_device_prop()
HIP(hipStream_t stream)
HIP::hip_stream()
HIP::hip_device()
HIP::hip_device_prop()
SYCL::SYCL(const sycl::queue&)
SYCL::sycl_queue() 
OpenACC(int async_arg)
OpenACC::acc_async_queue()
OpenACC::acc_device_number()
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