#ifndef HPC_ULMBLAS_MALLOC_H #define HPC_ULMBLAS_MALLOC_H 1 #include #ifdef MEM_ALIGN # include #endif namespace hpc { namespace ulmblas { template T * malloc(std::size_t n) { #ifdef MEM_ALIGN return reinterpret_cast(_mm_malloc(n*sizeof(T), MEM_ALIGN)); # else return new T[n]; # endif } template void free(T *block) { #ifdef MEM_ALIGN _mm_free(reinterpret_cast(block)); # else delete [] block; # endif } } } // namespace ulmblas, hpc #endif // HPC_ULMBLAS_MALLOC_H