43 use,
intrinsic :: iso_c_binding
134#if defined(HAVE_HIP) || defined(HAVE_CUDA) || defined(HAVE_OPENCL)
150 call neko_error(
'Only one device is supported per MPI rank')
156#if defined(HAVE_HIP) || defined(HAVE_CUDA) || defined(HAVE_OPENCL)
172 character(len=*),
intent(inout) :: name
198 type(c_ptr),
intent(inout) :: x_d
199 integer(c_size_t) :: s
209 call neko_error(
'Memory allocation on device failed')
213 call neko_error(
'Memory allocation on device failed')
218 call neko_error(
'Memory allocation on device failed')
225 type(c_ptr),
intent(inout) :: x_d
228 call neko_error(
'Memory deallocation on device failed')
232 call neko_error(
'Memory deallocation on device failed')
236 call neko_error(
'Memory deallocation on device failed')
244 type(c_ptr),
intent(inout) :: x_d
245 integer(c_int),
target,
value :: v
246 integer(c_size_t),
intent(in) :: s
247 logical,
optional :: sync
248 type(c_ptr),
optional :: strm
249 type(c_ptr) :: stream
250 logical :: sync_device
252 if (
present(sync))
then
255 sync_device = .false.
258 if (
present(strm))
then
274 s, 0, c_null_ptr, c_null_ptr) .ne.
cl_success)
then
279 if (sync_device)
then
287 integer,
intent(in) :: n
288 class(*),
intent(inout),
target :: x(:)
289 type(c_ptr),
intent(inout) :: x_d
290 integer,
intent(in),
value :: dir
292 type(c_ptr),
optional :: strm
293 type(c_ptr) :: ptr_h, copy_stream
294 integer(c_size_t) :: s
296 if (
present(strm))
then
304 s = n * int(4, c_size_t)
306 type is (
integer(i8))
307 s = n * int(8, c_size_t)
310 s = n * int(4, c_size_t)
312 type is (double precision)
313 s = n * int(8, c_size_t)
325 integer,
intent(in) :: n
326 class(*),
intent(inout),
target :: x(:,:)
327 type(c_ptr),
intent(inout) :: x_d
328 integer,
intent(in),
value :: dir
330 type(c_ptr),
optional :: strm
331 type(c_ptr) :: ptr_h, copy_stream
332 integer(c_size_t) :: s
334 if (
present(strm))
then
342 s = n * int(4, c_size_t)
344 type is (
integer(i8))
345 s = n * int(8, c_size_t)
348 s = n * int(4, c_size_t)
350 type is (double precision)
351 s = n * int(8, c_size_t)
363 integer,
intent(in) :: n
364 class(*),
intent(inout),
target :: x(:,:,:)
365 type(c_ptr),
intent(inout) :: x_d
366 integer,
intent(in),
value :: dir
368 type(c_ptr),
optional :: strm
369 type(c_ptr) :: ptr_h, copy_stream
370 integer(c_size_t) :: s
372 if (
present(strm))
then
380 s = n * int(4, c_size_t)
382 type is (
integer(i8))
383 s = n * int(8, c_size_t)
386 s = n * int(4, c_size_t)
388 type is (double precision)
389 s = n * int(8, c_size_t)
401 integer,
intent(in) :: n
402 class(*),
intent(inout),
target :: x(:,:,:,:)
403 type(c_ptr),
intent(inout) :: x_d
404 integer,
intent(in),
value :: dir
406 type(c_ptr),
optional :: strm
407 type(c_ptr) :: ptr_h, copy_stream
408 integer(c_size_t) :: s
410 if (
present(strm))
then
418 s = n * int(4, c_size_t)
420 type is (
integer(i8))
421 s = n * int(8, c_size_t)
424 s = n * int(4, c_size_t)
426 type is (double precision)
427 s = n * int(8, c_size_t)
441 type(c_ptr),
intent(inout) :: dst
442 type(c_ptr),
intent(inout) :: src
443 integer(c_size_t),
intent(in) :: s
444 integer,
intent(in),
value :: dir
445 logical,
optional :: sync
446 type(c_ptr),
optional :: strm
447 type(c_ptr) :: copy_stream
448 logical :: sync_device
450 if (
present(sync))
then
453 sync_device = .false.
456 if (
present(strm))
then
470 type(c_ptr),
intent(inout) :: ptr_h
471 type(c_ptr),
intent(inout) :: x_d
472 integer(c_size_t),
intent(in) :: s
473 integer,
intent(in),
value :: dir
474 logical,
intent(in) :: sync_device
475 type(c_ptr),
intent(inout) :: stream
478 if (sync_device)
then
488 call neko_error(
'Device memcpy async (host-to-device) failed')
493 call neko_error(
'Device memcpy async (device-to-host) failed')
498 call neko_error(
'Device memcpy async (device-to-device) failed')
501 call neko_error(
'Device memcpy failed (invalid direction')
503 if (sync_device)
then
510 call neko_error(
'Device memcpy async (host-to-device) failed')
515 call neko_error(
'Device memcpy async (device-to-host) failed')
520 call neko_error(
'Device memcpy async (device-to-device) failed')
523 call neko_error(
'Device memcpy failed (invalid direction')
525 if (sync_device)
then
529 if (sync_device)
then
532 ptr_h, 0, c_null_ptr, c_null_ptr) &
534 call neko_error(
'Device memcpy (host-to-device) failed')
538 0, c_null_ptr, c_null_ptr) &
540 call neko_error(
'Device memcpy (device-to-host) failed')
544 0, c_null_ptr, c_null_ptr) &
546 call neko_error(
'Device memcpy (device-to-device) failed')
549 call neko_error(
'Device memcpy failed (invalid direction')
554 ptr_h, 0, c_null_ptr, c_null_ptr) &
556 call neko_error(
'Device memcpy (host-to-device) failed')
560 0, c_null_ptr, c_null_ptr) &
562 call neko_error(
'Device memcpy (device-to-host) failed')
566 0, c_null_ptr, c_null_ptr) &
568 call neko_error(
'Device memcpy (device-to-device) failed')
571 call neko_error(
'Device memcpy failed (invalid direction')
579 class(*),
intent(inout),
target :: x(:)
580 type(c_ptr),
intent(inout) :: x_d
581 integer,
intent(in),
optional :: n
582 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
591 if (n_ .eq. 0)
return
592 if (.not. c_associated(x_d))
call neko_error(
'Attempting to associate' // &
593 ' to a null device pointer for a non-empty array')
597 htbl_ptr_h%ptr = c_loc(x)
598 type is (
integer(i8))
599 htbl_ptr_h%ptr = c_loc(x)
601 htbl_ptr_h%ptr = c_loc(x)
602 type is (double precision)
603 htbl_ptr_h%ptr = c_loc(x)
616 class(*),
intent(inout),
target :: x(:,:)
617 type(c_ptr),
intent(inout) :: x_d
618 integer,
intent(in),
optional :: n
619 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
628 if (n_ .eq. 0)
return
629 if (.not. c_associated(x_d))
call neko_error(
'Attempting to associate' // &
630 ' to a null device pointer for a non-empty array')
634 htbl_ptr_h%ptr = c_loc(x)
635 type is (
integer(i8))
636 htbl_ptr_h%ptr = c_loc(x)
638 htbl_ptr_h%ptr = c_loc(x)
639 type is (double precision)
640 htbl_ptr_h%ptr = c_loc(x)
653 class(*),
intent(inout),
target :: x(:,:,:)
654 type(c_ptr),
intent(inout) :: x_d
655 integer,
intent(in),
optional :: n
656 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
665 if (n_ .eq. 0)
return
666 if (.not. c_associated(x_d))
call neko_error(
'Attempting to associate' // &
667 ' to a null device pointer for a non-empty array')
670 htbl_ptr_h%ptr = c_loc(x)
671 type is (
integer(i8))
672 htbl_ptr_h%ptr = c_loc(x)
674 htbl_ptr_h%ptr = c_loc(x)
675 type is (double precision)
676 htbl_ptr_h%ptr = c_loc(x)
689 class(*),
intent(inout),
target :: x(:,:,:,:)
690 type(c_ptr),
intent(inout) :: x_d
691 integer,
intent(in),
optional :: n
692 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
701 if (n_ .eq. 0)
return
702 if (.not. c_associated(x_d))
call neko_error(
'Attempting to associate' // &
703 ' to a null device pointer for a non-empty array')
707 htbl_ptr_h%ptr = c_loc(x)
708 type is (
integer(i8))
709 htbl_ptr_h%ptr = c_loc(x)
711 htbl_ptr_h%ptr = c_loc(x)
712 type is (double precision)
713 htbl_ptr_h%ptr = c_loc(x)
726 class(*),
intent(inout),
target :: x(:)
727 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
731 htbl_ptr_h%ptr = c_loc(x)
732 type is (
integer(i8))
733 htbl_ptr_h%ptr = c_loc(x)
735 htbl_ptr_h%ptr = c_loc(x)
736 type is (double precision)
737 htbl_ptr_h%ptr = c_loc(x)
750 class(*),
intent(inout),
target :: x(:,:)
751 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
755 htbl_ptr_h%ptr = c_loc(x)
756 type is (
integer(i8))
757 htbl_ptr_h%ptr = c_loc(x)
759 htbl_ptr_h%ptr = c_loc(x)
760 type is (double precision)
761 htbl_ptr_h%ptr = c_loc(x)
774 class(*),
intent(inout),
target :: x(:,:,:)
775 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
779 htbl_ptr_h%ptr = c_loc(x)
780 type is (
integer(i8))
781 htbl_ptr_h%ptr = c_loc(x)
783 htbl_ptr_h%ptr = c_loc(x)
784 type is (double precision)
785 htbl_ptr_h%ptr = c_loc(x)
798 class(*),
intent(inout),
target :: x(:,:,:,:)
799 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
803 htbl_ptr_h%ptr = c_loc(x)
804 type is (
integer(i8))
805 htbl_ptr_h%ptr = c_loc(x)
807 htbl_ptr_h%ptr = c_loc(x)
808 type is (double precision)
809 htbl_ptr_h%ptr = c_loc(x)
822 integer,
intent(in) :: n
823 class(*),
intent(inout),
target :: x(:)
824 type(c_ptr),
intent(inout) :: x_d
825 integer(c_size_t) :: s
827 if (c_associated(x_d))
then
828 call neko_error(
'Device pointer already associated')
833 s = n * int(4, c_size_t)
834 type is (
integer(i8))
835 s = n * int(8, c_size_t)
837 s = n * int(4, c_size_t)
838 type is (double precision)
839 s = n * int(8, c_size_t)
851 integer,
intent(in) :: n
852 class(*),
intent(inout),
target :: x(:,:)
853 type(c_ptr),
intent(inout) :: x_d
854 integer(c_size_t) :: s
856 if (c_associated(x_d))
then
857 call neko_error(
'Device pointer already associated')
862 s = n * int(4, c_size_t)
863 type is (
integer(i8))
864 s = n * int(8, c_size_t)
866 s = n * int(4, c_size_t)
867 type is (double precision)
868 s = n * int(8, c_size_t)
880 integer,
intent(in) :: n
881 class(*),
intent(inout),
target :: x(:,:,:)
882 type(c_ptr),
intent(inout) :: x_d
883 integer(c_size_t) :: s
885 if (c_associated(x_d))
then
886 call neko_error(
'Device pointer already associated')
891 s = n * int(4, c_size_t)
892 type is (
integer(i8))
893 s = n * int(8, c_size_t)
895 s = n * int(4, c_size_t)
896 type is (double precision)
897 s = n * int(8, c_size_t)
909 integer,
intent(in) :: n
910 class(*),
intent(inout),
target :: x(:,:,:,:)
911 type(c_ptr),
intent(inout) :: x_d
912 integer(c_size_t) :: s
914 if (c_associated(x_d))
then
915 call neko_error(
'Device pointer already associated')
920 s = n * int(4, c_size_t)
921 type is (
integer(i8))
922 s = n * int(8, c_size_t)
924 s = n * int(4, c_size_t)
925 type is (double precision)
926 s = n * int(8, c_size_t)
938 class(*),
intent(inout),
target :: x(:)
939 type(c_ptr),
intent(inout) :: x_d
947 if ((.not. mapped) .and. (.not. c_associated(x_d)))
then
962 if ((.not. mapped) .or. (.not. c_associated(x_d)) .or. &
963 (.not. c_associated(dev, x_d)))
then
964 call neko_error(
'Inconsistent host/device mapping state in ' // &
975 class(*),
intent(inout),
target :: x(:,:)
976 type(c_ptr),
intent(inout) :: x_d
984 if ((.not. mapped) .and. (.not. c_associated(x_d)))
then
999 if ((.not. mapped) .or. (.not. c_associated(x_d)) .or. &
1000 (.not. c_associated(dev, x_d)))
then
1001 call neko_error(
'Inconsistent host/device mapping state in ' // &
1012 class(*),
intent(inout),
target :: x(:,:,:)
1013 type(c_ptr),
intent(inout) :: x_d
1021 if ((.not. mapped) .and. (.not. c_associated(x_d)))
then
1036 if ((.not. mapped) .or. (.not. c_associated(x_d)) .or. &
1037 (.not. c_associated(dev, x_d)))
then
1038 call neko_error(
'Inconsistent host/device mapping state in ' // &
1049 class(*),
intent(inout),
target :: x(:,:,:,:)
1050 type(c_ptr),
intent(inout) :: x_d
1058 if ((.not. mapped) .and. (.not. c_associated(x_d)))
then
1073 if ((.not. mapped) .or. (.not. c_associated(x_d)) .or. &
1074 (.not. c_associated(dev, x_d)))
then
1075 call neko_error(
'Inconsistent host/device mapping state in ' // &
1086 class(*),
intent(inout),
target :: x(:)
1087 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
1092 htbl_ptr_h%ptr = c_loc(x)
1093 type is (
integer(
i8))
1094 htbl_ptr_h%ptr = c_loc(x)
1096 htbl_ptr_h%ptr = c_loc(x)
1097 type is (double precision)
1098 htbl_ptr_h%ptr = c_loc(x)
1113 class(*),
intent(inout),
target :: x(:,:)
1114 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
1119 htbl_ptr_h%ptr = c_loc(x)
1120 type is (
integer(
i8))
1121 htbl_ptr_h%ptr = c_loc(x)
1123 htbl_ptr_h%ptr = c_loc(x)
1124 type is (double precision)
1125 htbl_ptr_h%ptr = c_loc(x)
1140 class(*),
intent(inout),
target :: x(:,:,:)
1141 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
1146 htbl_ptr_h%ptr = c_loc(x)
1147 type is (
integer(
i8))
1148 htbl_ptr_h%ptr = c_loc(x)
1150 htbl_ptr_h%ptr = c_loc(x)
1151 type is (double precision)
1152 htbl_ptr_h%ptr = c_loc(x)
1167 class(*),
intent(inout),
target :: x(:,:,:,:)
1168 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
1173 htbl_ptr_h%ptr = c_loc(x)
1174 type is (
integer(
i8))
1175 htbl_ptr_h%ptr = c_loc(x)
1177 htbl_ptr_h%ptr = c_loc(x)
1178 type is (double precision)
1179 htbl_ptr_h%ptr = c_loc(x)
1194 class(*),
intent(in),
target :: x(:)
1195 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
1202 htbl_ptr_h%ptr = c_loc(x)
1203 type is (
integer(
i8))
1204 htbl_ptr_h%ptr = c_loc(x)
1206 htbl_ptr_h%ptr = c_loc(x)
1207 type is (double precision)
1208 htbl_ptr_h%ptr = c_loc(x)
1216 call neko_error(
'Array not associated with device')
1222 class(*),
intent(in),
target :: x(:,:)
1223 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
1230 htbl_ptr_h%ptr = c_loc(x)
1231 type is (
integer(
i8))
1232 htbl_ptr_h%ptr = c_loc(x)
1234 htbl_ptr_h%ptr = c_loc(x)
1235 type is (double precision)
1236 htbl_ptr_h%ptr = c_loc(x)
1244 call neko_error(
'Array not associated with device')
1250 class(*),
intent(in),
target :: x(:,:,:)
1251 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
1258 htbl_ptr_h%ptr = c_loc(x)
1259 type is (
integer(
i8))
1260 htbl_ptr_h%ptr = c_loc(x)
1262 htbl_ptr_h%ptr = c_loc(x)
1263 type is (double precision)
1264 htbl_ptr_h%ptr = c_loc(x)
1272 call neko_error(
'Array not associated with device')
1278 class(*),
intent(in),
target :: x(:,:,:,:)
1279 type(
h_cptr_t) :: htbl_ptr_h, htbl_ptr_d
1286 htbl_ptr_h%ptr = c_loc(x)
1287 type is (
integer(
i8))
1288 htbl_ptr_h%ptr = c_loc(x)
1290 htbl_ptr_h%ptr = c_loc(x)
1291 type is (double precision)
1292 htbl_ptr_h%ptr = c_loc(x)
1300 call neko_error(
'Array not associated with device')
1323 type(c_ptr),
intent(in) :: stream
1341 type(c_ptr),
intent(inout) :: stream
1342 integer,
optional :: flags
1345 if (
present(flags))
then
1347 call neko_error(
'Error during stream create (w. flags)')
1351 call neko_error(
'Error during stream create')
1355 if (
present(flags))
then
1357 call neko_error(
'Error during stream create (w. flags)')
1361 call neko_error(
'Error during stream create')
1367 call neko_error(
'Error during stream create')
1374 type(c_ptr),
intent(inout) :: stream
1375 integer,
intent(in) :: flags, prio
1378 call neko_error(
'Error during stream create (w. priority)')
1382 call neko_error(
'Error during stream create (w. priority)')
1391 type(c_ptr),
intent(inout) :: stream
1394 call neko_error(
'Error during stream destroy')
1398 call neko_error(
'Error during stream destroy')
1402 call neko_error(
'Error during stream destroy')
1409 type(c_ptr),
intent(in) :: stream
1410 type(c_ptr),
target,
intent(in) :: event
1450 type(c_ptr),
intent(inout) :: event
1451 integer,
optional :: flags
1454 if (
present(flags))
then
1456 call neko_error(
'Error during event create (w. flags)')
1464 if (
present(flags))
then
1466 call neko_error(
'Error during event create (w. flags)')
1480 type(c_ptr),
intent(inout) :: event
1483 call neko_error(
'Error during event destroy')
1487 call neko_error(
'Error during event destroy')
1496 type(c_ptr),
target,
intent(in) :: event
1497 type(c_ptr),
intent(in) :: stream
1515 type(c_ptr),
target,
intent(in) :: event
1525 if (c_associated(event))
then
Associate a Fortran array to a (allocated) device pointer.
Check if a Fortran array is assoicated with a device pointer.
Deassociate a Fortran array from a device pointer.
Return the device pointer for an associated Fortran array.
Map a Fortran array to a device (allocate and associate)
Copy data between host and device (or device and device)
Synchronize a device or stream.
Unmap a Fortran array from a device (deassociate and free)
subroutine cuda_device_name(name)
subroutine cuda_finalize(glb_cmd_queue, aux_cmd_queue)
@ cudamemcpydevicetodevice
integer function cuda_device_count()
Return the number of avaialble CUDA devices.
subroutine cuda_init(glb_cmd_queue, aux_cmd_queue, strm_high_prio, strm_low_prio)
Device abstraction, common interface for various accelerators.
subroutine, public device_event_record(event, stream)
Record a device event.
subroutine device_associate_r4(x, x_d, n)
Associate a Fortran rank 4 array to a (allocated) device pointer.
subroutine, public device_event_sync(event)
Synchronize an event.
subroutine device_associate_r1(x, x_d, n)
Associate a Fortran rank 1 array to a (allocated) device pointer.
subroutine, public device_finalize
integer, parameter, public device_to_device
type(c_ptr) function device_get_ptr_r4(x)
Return the device pointer for an associated Fortran rank 4 array.
type(c_ptr) function device_get_ptr_r1(x)
Return the device pointer for an associated Fortran rank 1 array.
integer, public strm_low_prio
Low priority stream setting.
integer, parameter, public host_to_device
subroutine device_map_r3(x, x_d, n)
Map a Fortran rank 3 array to a device (allocate and associate)
type(c_ptr), bind(C), public prf_cmd_queue
Profiling command queue.
subroutine, private device_memcpy_common(ptr_h, x_d, s, dir, sync_device, stream)
Copy data between host and device.
logical function device_associated_r3(x)
Check if a Fortran rank 3 array is assoicated with a device pointer.
subroutine device_unmap_r4(x, x_d)
Unmap a Fortran rank 4 array from a device (deassociate and free)
type(htable_cptr_t), private device_addrtbl
Table of host to device address mappings.
subroutine, public device_profiler_stop()
Stop device profiling.
subroutine device_deassociate_r3(x)
Deassociate a Fortran rank 3 array from a device pointer.
subroutine, public device_sync_stream(stream)
Synchronize a device stream.
type(c_ptr) function device_get_ptr_r3(x)
Return the device pointer for an associated Fortran rank 3 array.
subroutine device_unmap_r2(x, x_d)
Unmap a Fortran rank 2 array from a device (deassociate and free)
subroutine, public device_profiler_start()
Start device profiling.
subroutine device_map_r2(x, x_d, n)
Map a Fortran rank 2 array to a device (allocate and associate)
subroutine device_memcpy_r2(x, x_d, n, dir, sync, strm)
Copy data between host and device (rank 2 arrays)
subroutine device_map_r4(x, x_d, n)
Map a Fortran rank 4 array to a device (allocate and associate)
subroutine, public device_free(x_d)
Deallocate memory on the device.
integer, parameter, public device_to_host
subroutine device_memcpy_cptr(dst, src, s, dir, sync, strm)
Copy data between host and device (or device and device) (c-pointers)
subroutine, public device_event_destroy(event)
Destroy a device event.
subroutine, public device_alloc(x_d, s)
Allocate memory on the device.
subroutine device_associate_r2(x, x_d, n)
Associate a Fortran rank 2 array to a (allocated) device pointer.
subroutine, public device_stream_create_with_priority(stream, flags, prio)
Create a device stream/command queue with priority.
subroutine, public device_stream_create(stream, flags)
Create a device stream/command queue.
subroutine device_deassociate_r4(x)
Deassociate a Fortran rank 4 array from a device pointer.
subroutine device_sync_device()
Synchronize the device.
subroutine device_memcpy_r4(x, x_d, n, dir, sync, strm)
Copy data between host and device (rank 4 arrays)
subroutine, public device_stream_wait_event(stream, event, flags)
Synchronize a device stream with an event.
subroutine device_map_r1(x, x_d, n)
Map a Fortran rank 1 array to a device (allocate and associate)
subroutine device_associate_r3(x, x_d, n)
Associate a Fortran rank 3 array to a (allocated) device pointer.
subroutine device_unmap_r1(x, x_d)
Unmap a Fortran rank 1 array from a device (deassociate and free)
subroutine device_memcpy_r1(x, x_d, n, dir, sync, strm)
Copy data between host and device (rank 1 arrays)
type(c_ptr), bind(C), public glb_cmd_queue
Global command queue.
subroutine, public device_event_create(event, flags)
Create a device event queue.
integer function, public device_count()
Return the number of available devices.
subroutine, public device_name(name)
logical function device_associated_r4(x)
Check if a Fortran rank 4 array is assoicated with a device pointer.
logical function device_associated_r2(x)
Check if a Fortran rank 2 array is assoicated with a device pointer.
integer, public strm_high_prio
High priority stream setting.
type(c_ptr), bind(C), public aux_cmd_queue
Aux command queue.
type(c_ptr) function device_get_ptr_r2(x)
Return the device pointer for an associated Fortran rank 2 array.
subroutine device_unmap_r3(x, x_d)
Unmap a Fortran rank 3 array from a device (deassociate and free)
subroutine device_deassociate_r1(x)
Deassociate a Fortran rank 1 array from a device pointer.
type(c_ptr), bind(C), public glb_cmd_event
Event for the global command queue.
subroutine device_deassociate_r2(x)
Deassociate a Fortran rank 2 array from a device pointer.
subroutine, public device_init
logical function device_associated_r1(x)
Check if a Fortran rank 1 array is assoicated with a device pointer.
subroutine, public device_memset(x_d, v, s, sync, strm)
Set memory on the device to a value.
subroutine device_memcpy_r3(x, x_d, n, dir, sync, strm)
Copy data between host and device (rank 3 arrays)
subroutine, public device_stream_destroy(stream)
Destroy a device stream/command queue.
subroutine hip_device_name(name)
@ hipmemcpydevicetodevice
subroutine hip_init(glb_cmd_queue, aux_cmd_queue, strm_high_prio, strm_low_prio)
subroutine hip_finalize(glb_cmd_queue, aux_cmd_queue)
integer function hip_device_count()
Return the number of available HIP devices.
Implements a hash table ADT.
integer, parameter neko_bcknd_device
integer, parameter, public i8
Fortran OpenCL interface.
subroutine opencl_device_name(name)
subroutine opencl_finalize(glb_cmd_queue, aux_cmd_queue, prf_cmd_queue)
integer function opencl_device_count()
Return the number of OpenCL devices.
subroutine opencl_init(glb_cmd_queue, aux_cmd_queue, prf_cmd_queue)
OpenCL JIT program library.
subroutine, public opencl_prgm_lib_release
C pointer based hash table.