Skip to content

Commit 327dd79

Browse files
committed
Formatted code to adhere to project coding standards
1 parent db38545 commit 327dd79

File tree

1 file changed

+14
-15
lines changed
  • examples/multi-setup-mallocMC/source

1 file changed

+14
-15
lines changed

examples/multi-setup-mallocMC/source/main.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ constexpr auto isSpan(T<TType, TExtent>) {
168168

169169
template <typename TNew, typename TOld, std::size_t TExtent>
170170
constexpr auto convertDataType(std::span<TOld, TExtent>& range) {
171-
return std::span<TNew>(
172-
reinterpret_cast<TNew*>(range.data()), range.size() * sizeof(TOld) / sizeof(TNew));
171+
return std::span<TNew>(reinterpret_cast<TNew*>(range.data()),
172+
range.size() * sizeof(TOld) / sizeof(TNew));
173173
}
174174

175175
struct IotaReductionChecker {
@@ -233,8 +233,7 @@ template <typename T> struct AcumulateChecksProvider {
233233
};
234234

235235
namespace setups {
236-
template<uint32_t size>
237-
struct MultiSetupMallocMCRecipe {
236+
template <uint32_t size> struct MultiSetupMallocMCRecipe {
238237
ALPAKA_FN_ACC MultiSetupMallocMCRecipe(std::tuple<MyAllocatorHandle> handleInTuple)
239238
: handle{std::get<0>(handleInTuple)} {}
240239
MyAllocatorHandle handle;
@@ -245,13 +244,13 @@ namespace setups {
245244

246245
ALPAKA_FN_ACC auto next([[maybe_unused]] const auto& acc) {
247246
if (counter >= numAllocations)
248-
return std::make_tuple(+kitgenbench::Actions::STOP,
249-
Payload(std::span<std::byte>{
250-
static_cast<std::byte*>(nullptr), allocation_size}));
247+
return std::make_tuple(
248+
+kitgenbench::Actions::STOP,
249+
Payload(std::span<std::byte>{static_cast<std::byte*>(nullptr), allocation_size}));
251250
pointers[counter] = static_cast<std::byte*>(handle.malloc(acc, allocation_size));
252-
auto result = std::make_tuple(
253-
+kitgenbench::Actions::MALLOC,
254-
Payload(std::span<std::byte>(pointers[counter], allocation_size)));
251+
auto result
252+
= std::make_tuple(+kitgenbench::Actions::MALLOC,
253+
Payload(std::span<std::byte>(pointers[counter], allocation_size)));
255254
counter++;
256255
return result;
257256
}
@@ -303,12 +302,12 @@ namespace setups {
303302

304303
using ALLOCATION_SIZES = std::integer_sequence<uint32_t, 16U, 32U, 128U, 256U, 512U, 1024U>;
305304

306-
template<uint32_t... sizes>
305+
template <uint32_t... sizes>
307306
auto composeSetups(auto allocatorHandle, std::integer_sequence<uint32_t, sizes...>) {
308307
auto execution = makeExecutionDetails();
309-
return std::make_tuple(
310-
setup::composeSetup((std::stringstream{} << "Single size: " << sizes).str(), execution,
311-
makeInstructionDetails<Acc, sizes>(execution.device, allocatorHandle), {})...);
308+
return std::make_tuple(setup::composeSetup(
309+
(std::stringstream{} << "Single size: " << sizes).str(), execution,
310+
makeInstructionDetails<Acc, sizes>(execution.device, allocatorHandle), {})...);
312311
}
313312
} // namespace setups
314313

@@ -344,7 +343,7 @@ auto main() -> int {
344343
auto execution = makeExecutionDetails();
345344
MyAllocator allocator = setupAllocator(execution.device, HEAP_SIZE);
346345
auto setup = setups::composeSetups(allocator.getAllocatorHandle(), setups::ALLOCATION_SIZES{});
347-
auto benchmarkReports = std::apply([](auto&&... args) {return runBenchmarks(args...); }, setup);
346+
auto benchmarkReports = std::apply([](auto&&... args) { return runBenchmarks(args...); }, setup);
348347
auto report = composeReport(metadata, benchmarkReports);
349348
output(report);
350349
return EXIT_SUCCESS;

0 commit comments

Comments
 (0)