diff --git a/include/alpaka/mem/global/DeviceGlobalGenericSycl.hpp b/include/alpaka/mem/global/DeviceGlobalGenericSycl.hpp index a3d815070fb..d38ba9771a8 100644 --- a/include/alpaka/mem/global/DeviceGlobalGenericSycl.hpp +++ b/include/alpaka/mem/global/DeviceGlobalGenericSycl.hpp @@ -41,7 +41,8 @@ namespace alpaka TExtent extent) { using Elem = alpaka::Elem>; - auto size = static_cast(getHeight(extent)) * static_cast(getDepth(extent)) * static_cast(getWidth(extent)) * sizeof(Elem); + auto size = static_cast(getHeight(extent)) * static_cast(getDepth(extent)) + * static_cast(getWidth(extent)) * sizeof(Elem); queue.getNativeHandle().memcpy(reinterpret_cast(getPtrNative(viewDst)), viewSrc, size); } @@ -54,8 +55,9 @@ namespace alpaka TExtent extent) { using Elem = alpaka::Elem; - auto size = static_cast(getHeight(extent)) * static_cast(getDepth(extent)) * static_cast(getWidth(extent)) * sizeof(Elem); - queue.getNativeHandle().memcpy(viewDst, reinterpret_cast(getPtrNative(viewSrc)), size); + auto size = static_cast(getHeight(extent)) * static_cast(getDepth(extent)) + * static_cast(getWidth(extent)) * sizeof(Elem); + queue.getNativeHandle().memcpy(viewDst, reinterpret_cast(getPtrNative(viewSrc)), size); } } // namespace alpaka #endif diff --git a/test/unit/mem/view/src/ViewStaticAccMem.cpp b/test/unit/mem/view/src/ViewStaticAccMem.cpp index 66082bc46d5..e053461b805 100644 --- a/test/unit/mem/view/src/ViewStaticAccMem.cpp +++ b/test/unit/mem/view/src/ViewStaticAccMem.cpp @@ -20,14 +20,14 @@ using Idx = std::uint32_t; // from a different compilation unit and should be moved to a common header. // Here they are used to silence clang`s -Wmissing-variable-declarations warning // that forces every non-static variable to be declared with extern before the are defined. -//extern ALPAKA_STATIC_ACC_MEM_GLOBAL(Elem[3][2], g_globalMemory2DUninitialized); +// extern ALPAKA_STATIC_ACC_MEM_GLOBAL(Elem[3][2], g_globalMemory2DUninitialized); ALPAKA_STATIC_ACC_MEM_GLOBAL(Elem[3][2], g_globalMemory2DUninitialized); // These forward declarations are only necessary when you want to access those variables // from a different compilation unit and should be moved to a common header. // Here they are used to silence clang`s -Wmissing-variable-declarations warning // that forces every non-static variable to be declared with extern before the are defined. -//extern ALPAKA_STATIC_ACC_MEM_CONSTANT(Elem[3][2], g_constantMemory2DUninitialized); +// extern ALPAKA_STATIC_ACC_MEM_CONSTANT(Elem[3][2], g_constantMemory2DUninitialized); ALPAKA_STATIC_ACC_MEM_CONSTANT(Elem[3][2], g_constantMemory2DUninitialized); //! Uses static device memory on the accelerator defined globally for the whole compilation unit. @@ -44,7 +44,10 @@ struct StaticDeviceMemoryTestKernel auto const val = offset; ALPAKA_CHECK(*success, val == *((&g_globalMemory2DUninitialized.get())[0][0] + offset)); - printf("%u = %u\n", val, *((&g_globalMemory2DUninitialized.get())[0][0] + offset)); // compila anche senza get() + printf( + "%u = %u\n", + val, + *((&g_globalMemory2DUninitialized.get())[0][0] + offset)); // compila anche senza get() } }; @@ -61,7 +64,10 @@ struct ConstantDeviceMemoryTestKernel auto const val = offset; ALPAKA_CHECK(*success, val == *((&g_constantMemory2DUninitialized.get())[0][0] + offset)); - printf("%u = %u\n", val, *((&g_constantMemory2DUninitialized.get())[0][0] + offset)); // compila anche senza get() + printf( + "%u = %u\n", + val, + *((&g_constantMemory2DUninitialized.get())[0][0] + offset)); // compila anche senza get() } }; @@ -73,8 +79,8 @@ TEMPLATE_LIST_TEST_CASE("staticDeviceMemoryGlobal", "[viewStaticAccMem]", TestAc using DevAcc = alpaka::Dev; auto const platformAcc = alpaka::Platform{}; - - std::cout << " acc:" << alpaka::core::demangled << std::endl; + + std::cout << " acc:" << alpaka::core::demangled << std::endl; auto const devAcc = alpaka::getDevByIdx(platformAcc, 0); alpaka::Vec const extent(3u, 2u); @@ -102,8 +108,8 @@ TEMPLATE_LIST_TEST_CASE("staticDeviceMemoryGlobal", "[viewStaticAccMem]", TestAc auto bufHost2 = alpaka::createView(devHost, data2.data(), extent); alpaka::memcpy(queueAcc, bufHost2, g_globalMemory2DUninitialized, extent); alpaka::wait(queueAcc); - for (auto& el : data2) - std::cout << el << " "; + for(auto& el : data2) + std::cout << el << " "; std::cout << std::endl; } }