Skip to content

Commit

Permalink
Changing the default memory space for Fortran bindings to correspond …
Browse files Browse the repository at this point in the history
…to the C++ one
  • Loading branch information
anagainaru committed Mar 19, 2024
1 parent a2375f0 commit 05caf52
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
8 changes: 0 additions & 8 deletions bindings/C/adios2/c/adios2_c_variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ adios2_error adios2_set_shape(adios2_variable *variable, const size_t ndims, con

adios2::MemorySpace adios2_ToMemorySpace(const adios2_memory_space Cmem)
{
#ifdef ADIOS2_HAVE_GPU_SUPPORT
adios2::MemorySpace mem = adios2::MemorySpace::Detect;
#else
adios2::MemorySpace mem = adios2::MemorySpace::Host;
#endif
switch (Cmem)
{

Expand All @@ -104,11 +100,7 @@ adios2::MemorySpace adios2_ToMemorySpace(const adios2_memory_space Cmem)

adios2_memory_space adios2_FromMemorySpace(const adios2::MemorySpace mem)
{
#ifdef ADIOS2_HAVE_GPU_SUPPORT
adios2_memory_space Cmem = adios2_memory_space_detect;
#else
adios2_memory_space Cmem = adios2_memory_space_host;
#endif
switch (mem)
{

Expand Down
4 changes: 2 additions & 2 deletions testing/adios2/bindings/fortran/TestBPMemorySpace.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ program TestBPMemorySpace
! check that the default execution space is Detect
call adios2_get_memory_space(mem, variable, ierr)
if (mem /= adios2_memory_space_detect) then
write(*,*) 'Invalid adios2_memory_space'
write(*,*) 'Invalid default adios2_memory_space'
stop 1
end if

! check that the execution space is updated to Host
call adios2_set_memory_space(variable, adios2_memory_space_host, ierr)
call adios2_get_memory_space(mem, variable, ierr)
if (mem /= adios2_memory_space_host) then
write(*,*) 'Invalid adios2_memory_space'
write(*,*) 'Invalid set adios2_memory_space'
stop 1
end if

Expand Down
4 changes: 2 additions & 2 deletions testing/adios2/bindings/fortran/TestBPMemorySpaceGPU.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ program TestBPMemorySpace
! check that the default execution space is Detect
call adios2_get_memory_space(mem, variable, ierr)
if (mem /= adios2_memory_space_detect) then
write(*,*) 'Invalid adios2_memory_space'
write(*,*) 'Invalid default adios2_memory_space'
stop 1
end if

! check that the execution space is updated to GPU
call adios2_set_memory_space(variable, adios2_memory_space_gpu, ierr)
call adios2_get_memory_space(mem, variable, ierr)
if (mem /= adios2_memory_space_gpu) then
write(*,*) 'Invalid adios2_memory_space'
write(*,*) 'Invalid set adios2_memory_space'
stop 1
end if

Expand Down

0 comments on commit 05caf52

Please sign in to comment.