Skip to content

Commit ebb67f4

Browse files
Remove the Dim class
1 parent a1acadf commit ebb67f4

File tree

3 files changed

+10
-71
lines changed

3 files changed

+10
-71
lines changed

offload/unittests/Conformance/include/mathtest/DeviceContext.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#define MATHTEST_DEVICECONTEXT_HPP
2020

2121
#include "mathtest/DeviceResources.hpp"
22-
#include "mathtest/Dim.hpp"
2322
#include "mathtest/ErrorHandling.hpp"
2423
#include "mathtest/Support.hpp"
2524

@@ -29,6 +28,7 @@
2928

3029
#include <cassert>
3130
#include <cstddef>
31+
#include <cstdint>
3232
#include <memory>
3333
#include <optional>
3434
#include <tuple>
@@ -111,8 +111,8 @@ class DeviceContext {
111111
}
112112

113113
template <typename KernelSignature, typename... ArgTypes>
114-
void launchKernel(DeviceKernel<KernelSignature> Kernel, Dim NumGroups,
115-
Dim GroupSize, ArgTypes &&...Args) const noexcept {
114+
void launchKernel(DeviceKernel<KernelSignature> Kernel, uint32_t NumGroups,
115+
uint32_t GroupSize, ArgTypes &&...Args) const noexcept {
116116
using ExpectedTypes =
117117
typename FunctionTypeTraits<KernelSignature>::ArgTypesTuple;
118118
using ProvidedTypes = std::tuple<std::decay_t<ArgTypes>...>;
@@ -151,8 +151,8 @@ class DeviceContext {
151151
getKernelImpl(ol_program_handle_t ProgramHandle,
152152
llvm::StringRef KernelName) const noexcept;
153153

154-
void launchKernelImpl(ol_symbol_handle_t KernelHandle, const Dim &NumGroups,
155-
const Dim &GroupSize, const void *KernelArgs,
154+
void launchKernelImpl(ol_symbol_handle_t KernelHandle, uint32_t NumGroups,
155+
uint32_t GroupSize, const void *KernelArgs,
156156
std::size_t KernelArgsSize) const noexcept;
157157

158158
std::size_t GlobalDeviceId;

offload/unittests/Conformance/include/mathtest/Dim.hpp

Lines changed: 0 additions & 61 deletions
This file was deleted.

offload/unittests/Conformance/lib/DeviceContext.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include <OffloadAPI.h>
3131
#include <cstddef>
32+
#include <cstdint>
3233
#include <memory>
3334
#include <optional>
3435
#include <string>
@@ -299,13 +300,12 @@ DeviceContext::getKernelImpl(ol_program_handle_t ProgramHandle,
299300
}
300301

301302
void DeviceContext::launchKernelImpl(
302-
ol_symbol_handle_t KernelHandle, const Dim &NumGroups, const Dim &GroupSize,
303+
ol_symbol_handle_t KernelHandle, uint32_t NumGroups, uint32_t GroupSize,
303304
const void *KernelArgs, std::size_t KernelArgsSize) const noexcept {
304305
ol_kernel_launch_size_args_t LaunchArgs;
305-
LaunchArgs.Dimensions = 3; // It seems this field is not used anywhere.
306-
// Defaulting to the safest value.
307-
LaunchArgs.NumGroups = {NumGroups[0], NumGroups[1], NumGroups[2]};
308-
LaunchArgs.GroupSize = {GroupSize[0], GroupSize[1], GroupSize[2]};
306+
LaunchArgs.Dimensions = 1;
307+
LaunchArgs.NumGroups = {NumGroups, 1, 1};
308+
LaunchArgs.GroupSize = {GroupSize, 1, 1};
309309
LaunchArgs.DynSharedMemory = 0;
310310

311311
OL_CHECK(olLaunchKernel(nullptr, DeviceHandle, KernelHandle, KernelArgs,

0 commit comments

Comments
 (0)