@@ -90,7 +90,7 @@ struct cast_memory_op<FPTYPE_out, FPTYPE_in, base_device::DEVICE_CPU, base_devic
9090template <typename FPTYPE>
9191struct delete_memory_op <FPTYPE, base_device::DEVICE_CPU>
9292{
93- void operator ()(const base_device::DEVICE_CPU* dev, FPTYPE* arr)
93+ void operator ()(FPTYPE* arr)
9494 {
9595 free (arr);
9696 }
@@ -230,7 +230,7 @@ struct cast_memory_op<FPTYPE_out, FPTYPE_in, base_device::DEVICE_CPU, base_devic
230230template <typename FPTYPE>
231231struct delete_memory_op <FPTYPE, base_device::DEVICE_GPU>
232232{
233- void operator ()(const base_device::DEVICE_GPU* dev, FPTYPE* arr)
233+ void operator ()(FPTYPE* arr)
234234 {
235235 }
236236};
@@ -336,7 +336,7 @@ template struct delete_memory_op<std::complex<double>, base_device::DEVICE_GPU>;
336336template <typename FPTYPE>
337337struct resize_memory_op_mt <FPTYPE, base_device::DEVICE_CPU>
338338{
339- void operator ()(const base_device::DEVICE_CPU* dev, FPTYPE*& arr, const size_t size, const char * record_in)
339+ void operator ()(FPTYPE*& arr, const size_t size, const char * record_in)
340340 {
341341 if (arr != nullptr )
342342 {
@@ -363,7 +363,7 @@ struct resize_memory_op_mt<FPTYPE, base_device::DEVICE_CPU>
363363template <typename FPTYPE>
364364struct delete_memory_op_mt <FPTYPE, base_device::DEVICE_CPU>
365365{
366- void operator ()(const base_device::DEVICE_CPU* dev, FPTYPE* arr)
366+ void operator ()(FPTYPE* arr)
367367 {
368368 free_ht (arr);
369369 }
@@ -397,54 +397,54 @@ void resize_memory(FPTYPE* arr, const size_t size, base_device::AbacusDevice_t d
397397template <typename FPTYPE>
398398void set_memory (FPTYPE* arr, const int var, const size_t size, base_device::AbacusDevice_t device_type){
399399 if (device_type == base_device::AbacusDevice_t::CpuDevice){
400- set_memory_op<FPTYPE, base_device::DEVICE_CPU>()(cpu_ctx, arr, var, size);
400+ set_memory_op<FPTYPE, base_device::DEVICE_CPU>()(arr, var, size);
401401 }
402402 else if (device_type == base_device::AbacusDevice_t::GpuDevice){
403- set_memory_op<FPTYPE, base_device::DEVICE_GPU>()(gpu_ctx, arr, var, size);
403+ set_memory_op<FPTYPE, base_device::DEVICE_GPU>()(arr, var, size);
404404 }
405405}
406406
407407template <typename FPTYPE>
408408void synchronize_memory (FPTYPE* arr_out, const FPTYPE* arr_in, const size_t size, base_device::AbacusDevice_t device_type_out, base_device::AbacusDevice_t device_type_in){
409409 if (device_type_out == base_device::AbacusDevice_t::CpuDevice || device_type_in == base_device::AbacusDevice_t::CpuDevice){
410- synchronize_memory_op<FPTYPE, DEVICE_CPU, DEVICE_CPU>()(cpu_ctx, cpu_ctx, arr_out, arr_in, size);
410+ synchronize_memory_op<FPTYPE, DEVICE_CPU, DEVICE_CPU>()(arr_out, arr_in, size);
411411 }
412412 else if (device_type_out == base_device::AbacusDevice_t::CpuDevice || device_type_in == base_device::AbacusDevice_t::GpuDevice){
413- synchronize_memory_op<FPTYPE, DEVICE_CPU, DEVICE_GPU>()(cpu_ctx, gpu_ctx, arr_out, arr_in, size);
413+ synchronize_memory_op<FPTYPE, DEVICE_CPU, DEVICE_GPU>()(arr_out, arr_in, size);
414414 }
415415 else if (device_type_out == base_device::AbacusDevice_t::GpuDevice || device_type_in == base_device::AbacusDevice_t::CpuDevice){
416- synchronize_memory_op<FPTYPE, DEVICE_GPU, DEVICE_CPU>()(gpu_ctx, cpu_ctx, arr_out, arr_in, size);
416+ synchronize_memory_op<FPTYPE, DEVICE_GPU, DEVICE_CPU>()(arr_out, arr_in, size);
417417 }
418418 else if (device_type_out == base_device::AbacusDevice_t::GpuDevice || device_type_in == base_device::AbacusDevice_t::GpuDevice){
419- synchronize_memory_op<FPTYPE, DEVICE_GPU, DEVICE_GPU>()(gpu_ctx, gpu_ctx, arr_out, arr_in, size);
419+ synchronize_memory_op<FPTYPE, DEVICE_GPU, DEVICE_GPU>()(arr_out, arr_in, size);
420420 }
421421}
422422
423423template <typename FPTYPE_out, typename FPTYPE_in>
424424void cast_memory (FPTYPE_out* arr_out, const FPTYPE_in* arr_in, const size_t size, base_device::AbacusDevice_t device_type_out, base_device::AbacusDevice_t device_type_in)
425425{
426426 if (device_type_out == base_device::AbacusDevice_t::CpuDevice || device_type_in == base_device::AbacusDevice_t::CpuDevice){
427- cast_memory_op<FPTYPE_out, FPTYPE_in, DEVICE_CPU, DEVICE_CPU>()(cpu_ctx, cpu_ctx, arr_out, arr_in, size);
427+ cast_memory_op<FPTYPE_out, FPTYPE_in, DEVICE_CPU, DEVICE_CPU>()(arr_out, arr_in, size);
428428 }
429429 else if (device_type_out == base_device::AbacusDevice_t::CpuDevice || device_type_in == base_device::AbacusDevice_t::GpuDevice){
430- cast_memory_op<FPTYPE_out, FPTYPE_in, DEVICE_CPU, DEVICE_GPU>()(cpu_ctx, gpu_ctx, arr_out, arr_in, size);
430+ cast_memory_op<FPTYPE_out, FPTYPE_in, DEVICE_CPU, DEVICE_GPU>()(arr_out, arr_in, size);
431431 }
432432 else if (device_type_out == base_device::AbacusDevice_t::GpuDevice || device_type_in == base_device::AbacusDevice_t::CpuDevice){
433- cast_memory_op<FPTYPE_out, FPTYPE_in, DEVICE_GPU, DEVICE_CPU>()(gpu_ctx, cpu_ctx, arr_out, arr_in, size);
433+ cast_memory_op<FPTYPE_out, FPTYPE_in, DEVICE_GPU, DEVICE_CPU>()(arr_out, arr_in, size);
434434 }
435435 else if (device_type_out == base_device::AbacusDevice_t::GpuDevice || device_type_in == base_device::AbacusDevice_t::GpuDevice){
436- cast_memory_op<FPTYPE_out, FPTYPE_in, DEVICE_GPU, DEVICE_GPU>()(gpu_ctx, gpu_ctx, arr_out, arr_in, size);
436+ cast_memory_op<FPTYPE_out, FPTYPE_in, DEVICE_GPU, DEVICE_GPU>()(arr_out, arr_in, size);
437437 }
438438}
439439
440440template <typename FPTYPE>
441441void delete_memory (FPTYPE* arr, base_device::AbacusDevice_t device_type)
442442{
443443 if (device_type == base_device::AbacusDevice_t::CpuDevice){
444- delete_memory_op<FPTYPE, DEVICE_CPU>()(cpu_ctx, arr);
444+ delete_memory_op<FPTYPE, DEVICE_CPU>()(arr);
445445 }
446446 else if (device_type == base_device::AbacusDevice_t::GpuDevice){
447- delete_memory_op<FPTYPE, DEVICE_GPU>()(gpu_ctx, arr);
447+ delete_memory_op<FPTYPE, DEVICE_GPU>()(arr);
448448 }
449449}
450450
0 commit comments