Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
make_ndrange.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
18
20#include "shambackends/sycl.hpp"
21
22namespace sham {
23
26 inline sycl::nd_range<1> make_ndrange(u32 wg_size, u32 nthread) {
27 u32 nthread_rounded = ((nthread + wg_size - 1) / wg_size) * wg_size;
28 return sycl::nd_range<1>(sycl::range<1>(nthread_rounded), sycl::range<1>(wg_size));
29 }
30
31} // namespace sham
std::uint32_t u32
32 bit unsigned integer
namespace for backends this one is named only sham since shambackends is too long to write
sycl::nd_range< 1 > make_ndrange(u32 wg_size, u32 nthread)