MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / allocate

Method allocate

deepspeed/ops/csrc/adam/cpu_adam.cpp:61–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59{
60 using value_type = T;
61 T* allocate(std::size_t num)
62 {
63 void* ptr = nullptr;
64 if (posix_memalign(&ptr,4096,num*sizeof(T)))
65 throw std::bad_alloc();
66 return reinterpret_cast<T*>(ptr);
67 }
68 void deallocate(T* p, std::size_t num)
69 {
70 free(p);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected