MCPcopy Create free account
hub / github.com/SeisSol/SeisSol / memzero

Function memzero

src/Initializer/MemoryAllocator.cpp:190–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void memzero(void* dst, std::size_t size, enum Memkind memkind) {
191 if (memkind == Memkind::DeviceGlobalMemory) {
192#ifdef ACL_DEVICE
193 auto defaultStream = device::DeviceInstance::getInstance().api->getDefaultStream();
194 device::DeviceInstance::getInstance().algorithms.fillArray(
195 reinterpret_cast<char*>(dst), static_cast<char>(0), size, defaultStream);
196 device::DeviceInstance::getInstance().api->syncDefaultStreamWithHost();
197#else
198 assert(false);
199#endif
200 } else {
201 std::memset(dst, 0, size);
202 }
203}
204
205void* hostToDevicePointer(void* host, enum Memkind memkind) {
206 if (host == nullptr) {

Callers 1

memzeroTypedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected