30 use iso_c_binding,
only: c_null_ptr, c_size_t
31 use,
intrinsic :: iso_fortran_env
90 integer,
public,
parameter :: &
91 ACCEL_MEM_READ_ONLY = 0, &
98 type(c_ptr) :: cuda_context
106#if defined(HAVE_CUDA)
107 type(c_ptr) :: cuda_device
115 type(accel_context_t) :: context
116 type(accel_device_t) :: device
117 type(c_ptr) :: cuda_stream
118 type(c_ptr) :: program_map
119 integer :: max_block_size
120 integer(int64) :: shared_memory_size
121 integer(int64) :: global_memory_size
123 logical :: allow_CPU_only
126 integer(int64) :: initialize_buffers
127 character(len=32) :: debug_flag
128 integer(int64) :: max_block_dim(3)
129 integer(int64) :: max_grid_dim(3)
135 integer(c_size_t) :: size = 0
138 logical :: allocated = .false.
144 type(c_ptr) :: cuda_kernel
145 type(c_ptr) :: arguments
147 logical :: initialized = .false.
148 type(accel_kernel_t),
pointer :: next
150 character(len=128) :: kernel_name
153 type(accel_t),
public :: accel
156 type(accel_kernel_t),
public,
target,
save :: kernel_vpsi
157 type(accel_kernel_t),
public,
target,
save :: kernel_vpsi_complex
158 type(accel_kernel_t),
public,
target,
save :: kernel_vpsi_spinors
159 type(accel_kernel_t),
public,
target,
save :: kernel_vpsi_spinors_complex
160 type(accel_kernel_t),
public,
target,
save :: kernel_daxpy
161 type(accel_kernel_t),
public,
target,
save :: kernel_zaxpy
162 type(accel_kernel_t),
public,
target,
save :: kernel_saxpy
163 type(accel_kernel_t),
public,
target,
save :: kernel_caxpy
164 type(accel_kernel_t),
public,
target,
save :: kernel_copy
165 type(accel_kernel_t),
public,
target,
save :: kernel_scopy
166 type(accel_kernel_t),
public,
target,
save :: kernel_copy_complex_to_real
167 type(accel_kernel_t),
public,
target,
save :: kernel_copy_real_to_complex
168 type(accel_kernel_t),
public,
target,
save :: dpack
169 type(accel_kernel_t),
public,
target,
save :: zpack
170 type(accel_kernel_t),
public,
target,
save :: spack
171 type(accel_kernel_t),
public,
target,
save :: cpack
172 type(accel_kernel_t),
public,
target,
save :: dunpack
173 type(accel_kernel_t),
public,
target,
save :: zunpack
174 type(accel_kernel_t),
public,
target,
save :: sunpack
175 type(accel_kernel_t),
public,
target,
save :: cunpack
176 type(accel_kernel_t),
public,
target,
save :: kernel_ghost_reorder
177 type(accel_kernel_t),
public,
target,
save :: kernel_density_real
178 type(accel_kernel_t),
public,
target,
save :: kernel_density_complex
179 type(accel_kernel_t),
public,
target,
save :: kernel_density_spinors
180 type(accel_kernel_t),
public,
target,
save :: kernel_phase
181 type(accel_kernel_t),
public,
target,
save :: kernel_phase_spiral
182 type(accel_kernel_t),
public,
target,
save :: zkernel_dot_matrix_spinors
183 type(accel_kernel_t),
public,
target,
save :: dzmul_batch
184 type(accel_kernel_t),
public,
target,
save :: zzmul_batch
311 integer :: buffer_alloc_count
312 integer(int64) :: allocated_mem
313 type(accel_kernel_t),
pointer :: head
314 type(alloc_cache_t) :: memcache
320 enabled = accel%enabled
330 allow = accel%allow_CPU_only
339 type(mpi_grp_t),
intent(inout) :: base_grp
340 type(namespace_t),
intent(in) :: namespace
342 logical :: disable, default, run_benchmark
347 character(len=256) :: sys_name
353 buffer_alloc_count = 0
371 accel%enabled = .not. disable
374 if (accel%enabled)
then
375 message(1) =
'Octopus was compiled without Cuda support.'
403 if (idevice < 0)
then
411 if (idevice<0) idevice = 0
412 call cuda_init(accel%context%cuda_context, accel%device%cuda_device, accel%cuda_stream, &
413 idevice, base_grp%rank)
416 write(
message(1),
'(A,I5,A,I5,2A)')
"Rank ", base_grp%rank,
" uses device number ", idevice, &
417 " on ", trim(sys_name)
432 accel%max_block_dim(1) = int(dim, int64)
434 accel%max_block_dim(2) = int(dim, int64)
436 accel%max_block_dim(3) = int(dim, int64)
438 accel%max_grid_dim(1) = int(dim, int64)
440 accel%max_grid_dim(2) = int(dim, int64)
442 accel%max_grid_dim(3) = int(dim, int64)
448 call alloc_cache_init(memcache, nint(0.25_real64*accel%global_memory_size, int64))
454 accel%debug_flag =
"-g"
455#elif defined(HAVE_CUDA)
456 accel%debug_flag =
"-lineinfo"
499 call parse_variable(namespace,
'AccelBenchmark', .false., run_benchmark)
503 if (run_benchmark)
then
524 call parse_variable(namespace,
'GPUAwareMPI', default, accel%cuda_mpi)
525 if (accel%cuda_mpi)
then
527 call messages_write(
"Warning: trying to use GPU-aware MPI, but we have not detected support in the linked MPI library.")
543#if defined (HAVE_ACCEL)
548 call parse_variable(namespace,
'AllowCPUonly', default, accel%allow_CPU_only)
564 call parse_variable(namespace,
'InitializeGPUBuffers', option__initializegpubuffers__no, accel%initialize_buffers)
579 character(kind=c_char) :: cval_str(257)
581 integer :: major, minor
582 character(len=256) :: val_str
591#ifdef __HIP_PLATFORM_AMD__
601#ifdef __HIP_PLATFORM_AMD__
609 cval_str = c_null_char
657 integer(int64) :: hits, misses
658 real(real64) :: volume_hits, volume_misses
670 if (.not. found)
exit
677 call alloc_cache_end(memcache, hits, misses, volume_hits, volume_misses)
688 if (hits + misses > 0)
then
689 call messages_write(hits/real(hits + misses, real64)*100, fmt=
'(f6.1)', align_left = .
true.)
695 if (volume_hits + volume_misses > 0)
then
696 call messages_write(volume_hits/(volume_hits + volume_misses)*100, fmt=
'(f6.1)', align_left = .
true.)
712 if (.not. accel%cuda_mpi)
then
713 call cuda_end(accel%context%cuda_context, accel%device%cuda_device)
717 if (buffer_alloc_count /= 0)
then
735 integer(int64),
intent(in) :: n(:)
736 integer(int64),
intent(in) :: blocksizes(:)
737 integer(int64),
intent(out) :: gridsizes(:)
741 dim = ubound(n, dim=1)
742 assert(dim == ubound(blocksizes, dim=1))
743 assert(dim == ubound(gridsizes, dim=1))
746 gridsizes(i) = (n(i) + blocksizes(i) - 1_int64) / blocksizes(i)
747 gridsizes(i) = min(gridsizes(i), accel%max_grid_dim(i))
755 integer,
intent(in) :: n(:)
756 integer,
intent(in) :: blocksizes(:)
757 integer,
intent(out) :: gridsizes(:)
759 integer(int64) :: gridsizes64(size(gridsizes))
763 gridsizes = int(gridsizes64, int32)
770 integer(int64),
intent(in) :: n
771 integer(int64),
intent(in) :: blocksizes
772 integer(int64),
intent(out) :: gridsizes
774 integer(int64) :: temp(1)
785 integer,
intent(in) :: n
786 integer,
intent(in) :: blocksizes
787 integer,
intent(out) :: gridsizes
789 integer(int64) :: temp(1)
793 gridsizes = int(temp(1), int32)
802 integer(int64),
intent(in) :: n
803 integer(int64),
intent(in) :: pack_size
804 integer(int64),
dimension(3),
intent(out) :: gridsizes
805 integer(int64),
dimension(3),
intent(out) :: blocksizes
808 integer(int64) :: bsize, dim2, dim3
809 integer(int64),
dimension(3) :: nn
811 if(
present(kernel))
then
820 nn = (/pack_size, dim2, dim3/)
821 blocksizes = (/pack_size, bsize, 1_int64/)
832 integer,
intent(in) :: n
833 integer,
intent(in) :: pack_size
834 integer,
dimension(3),
intent(out) :: gridsizes
835 integer,
dimension(3),
intent(out) :: blocksizes
838 integer(int64) :: gridsizes64(3), blocksizes64(3)
841 gridsizes64, blocksizes64, kernel=kernel)
843 gridsizes = int(gridsizes64, int32)
844 blocksizes = int(blocksizes64, int32)
850 integer(int64),
intent(in) :: nn
852 integer(int64) :: modnn, bsize
861 modnn = mod(nn, bsize)
862 if (modnn /= 0) psize = psize + bsize - modnn
871 integer(int32),
intent(in) :: nn
881 integer,
intent(in) :: flags
882 type(
type_t),
intent(in) :: type
883 integer,
intent(in) :: size
884 logical,
optional,
intent(in) :: set_zero
885 logical,
optional,
intent(in) :: async
894 integer,
intent(in) :: flags
895 type(
type_t),
intent(in) :: type
896 integer(int64),
intent(in) :: size
897 logical,
optional,
intent(in) :: set_zero
898 logical,
optional,
intent(in) :: async
900 integer(int64) :: fsize
902 integer(int64) :: initialize_buffers
910 this%allocated = .
true.
916 if (.not. found)
then
926 buffer_alloc_count = buffer_alloc_count + 1
927 allocated_mem = allocated_mem + fsize
931 if (
present(set_zero))
then
932 initialize_buffers = merge(option__initializegpubuffers__yes, option__initializegpubuffers__no, set_zero)
934 initialize_buffers = accel%initialize_buffers
936 select case (initialize_buffers)
937 case (option__initializegpubuffers__yes)
939 case (option__initializegpubuffers__nan)
950 logical,
optional,
intent(in) :: async
953 integer(int64) :: fsize
957 if (this%size > 0)
then
973 buffer_alloc_count = buffer_alloc_count - 1
974 allocated_mem = allocated_mem + fsize
981 this%allocated = .false.
1000 buffer_to%mem = buffer_from%mem
1001 buffer_to%size = buffer_from%size
1002 buffer_to%type = buffer_from%type
1003 buffer_to%flags = buffer_from%flags
1004 buffer_to%allocated = buffer_from%allocated
1022 this%mem = c_null_ptr
1026 this%allocated = .false.
1036 integer,
intent(in) :: flags
1037 type(
type_t),
intent(in) :: type
1038 integer,
intent(in) :: required_size
1039 logical,
intent(in) :: set_zero
1040 logical,
optional,
intent(in) :: async
1055 integer,
intent(in) :: flags
1056 type(
type_t),
intent(in) :: type
1057 integer(int64),
intent(in) :: required_size
1058 logical,
intent(in) :: set_zero
1059 logical,
optional,
intent(in) :: async
1080 allocated = this%allocated
1099 integer,
intent(in) :: narg
1121 integer(int64),
intent(in) :: gridsizes(:)
1122 integer(int64),
intent(in) :: blocksizes(:)
1123 integer(int64),
optional,
intent(in) :: shared_memory_size
1126 integer(int64) :: gsizes(1:3)
1127 integer(int64) :: bsizes(1:3)
1135 dim = ubound(gridsizes, dim=1)
1137 assert(dim == ubound(blocksizes, dim=1))
1140 if (any(gridsizes == 0))
return
1142 assert(all(blocksizes > 0))
1144 gsizes(1:dim) = gridsizes(1:dim)
1145 bsizes(1:dim) = blocksizes(1:dim)
1149 if (any(bsizes(1:3) > accel%max_block_dim(1:3)))
then
1150 message(1) =
"Maximum dimension of a block too large in kernel "//trim(kernel%kernel_name)
1151 message(2) =
"The following conditions should be fulfilled:"
1152 write(
message(3),
"(A, I8, A, I8)")
"Dim 1: ", bsizes(1),
" <= ", accel%max_block_dim(1)
1153 write(
message(4),
"(A, I8, A, I8)")
"Dim 2: ", bsizes(2),
" <= ", accel%max_block_dim(2)
1154 write(
message(5),
"(A, I8, A, I8)")
"Dim 3: ", bsizes(3),
" <= ", accel%max_block_dim(3)
1155 message(6) =
"This is an internal error, please contact the developers."
1162 message(1) =
"Maximum number of threads per block too large in kernel "//trim(kernel%kernel_name)
1163 message(2) =
"The following condition should be fulfilled:"
1165 message(4) =
"This is an internal error, please contact the developers."
1170 if (any(gsizes(1:3) > accel%max_grid_dim(1:3)))
then
1171 message(1) =
"Maximum dimension of grid too large in kernel "//trim(kernel%kernel_name)
1172 message(2) =
"The following conditions should be fulfilled:"
1173 write(
message(3),
"(A, I8, A, I10)")
"Dim 1: ", gsizes(1),
" <= ", accel%max_grid_dim(1)
1174 write(
message(4),
"(A, I8, A, I10)")
"Dim 2: ", gsizes(2),
" <= ", accel%max_grid_dim(2)
1175 write(
message(5),
"(A, I8, A, I10)")
"Dim 3: ", gsizes(3),
" <= ", accel%max_grid_dim(3)
1176 message(6) =
"This is an internal error, please contact the developers."
1180 if(
present(shared_memory_size))
then
1182 if (shared_memory_size > accel%shared_memory_size)
then
1183 message(1) =
"Shared memory too large in kernel "//trim(kernel%kernel_name)
1184 message(2) =
"The following condition should be fulfilled:"
1185 message(3) =
"Requested shared memory <= Available shared memory"
1186 write(
message(4),
'(a,f12.6,a)')
"Requested shared memory: ", real(shared_memory_size, real64) /1024.0,
" Kb"
1187 write(
message(5),
'(a,f12.6,a)')
"Available shared memory: ", real(accel%shared_memory_size, real64) /1024.0,
" Kb"
1188 message(6) =
"This is an internal error, please contact the developers."
1190 else if (shared_memory_size <= 0)
then
1191 message(1) =
"Invalid shared memory size in kernel "//trim(kernel%kernel_name)
1192 write(
message(2),
'(a,f12.6,a)')
"Shared memory size requested: ", real(shared_memory_size, real64) /1024.0,
" Kb"
1193 message(3) =
"This is an internal error, please contact the developers."
1214 integer,
intent(in) :: gridsizes(:)
1215 integer,
intent(in) :: blocksizes(:)
1216 integer(int64),
optional,
intent(in) :: shared_memory_size
1218 call accel_kernel_run_8(kernel, int(gridsizes, int64), int(blocksizes, int64), shared_memory_size)
1225 max_block_size = accel%max_block_size
1234 integer :: max_block_size
1240 call cuda_kernel_max_threads_per_block(kernel%cuda_kernel, max_block_size)
1241 if (debug%info .and. max_block_size /=
accel%max_block_size)
then
1242 write(message(1),
"(A, I5, A)")
"A kernel can use only less threads per block (", max_block_size,
")", &
1243 "than available on the device (",
accel%max_block_size,
")"
1244 call messages_info(1)
1252 block_size = min(block_size, max_block_size)
1260 subroutine accel_copy_buffer(dest, src, type, nval, offset_dest, offset_src, async)
1263 type(type_t),
intent(in) :: type
1264 integer(int64),
intent(in) :: nval
1265 integer(int64),
optional,
intent(in) :: offset_dest
1266 integer(int64),
optional,
intent(in) :: offset_src
1267 logical,
optional,
intent(in) :: async
1269 integer(int64) :: type_size, offset_dest_, offset_src_
1272 call profiling_in(
"ACCEL_COPY_BUFFER")
1275 call profiling_out(
"ACCEL_COPY_BUFFER")
1281 type_size = types_get_size(type)
1283 offset_dest_ = 0_int64
1284 if (
present(offset_dest)) offset_dest_ = offset_dest*type_size
1285 offset_src_ = 0_int64
1286 if (
present(offset_src)) offset_src_ = offset_src*type_size
1288 assert(offset_dest_ + nval*type_size <= int(dest%size, int64)*types_get_size(dest%type))
1289 assert(offset_src_ + nval*type_size <= int(src%size, int64)*types_get_size(src%type))
1291 call cuda_memcpy_dtod(dest%mem, src%mem, nval*type_size, offset_dest_, offset_src_)
1293 if (.not. optional_default(async, .false.))
call accel_finish()
1295 call profiling_out(
"ACCEL_COPY_BUFFER")
1303 type(type_t),
intent(in) :: type
1304 integer(int8),
intent(in) :: val
1305 integer(int64),
intent(in) :: nval
1306 integer(int64),
optional,
intent(in) :: offset
1307 logical,
optional,
intent(in) :: async
1309 integer(int64) :: nval_, offset_, type_size
1319 if (
present(offset))
then
1321 if(offset > buffer%size)
then
1327 type_size = types_get_size(type)
1329 nval_ = nval*type_size
1332 if (
present(offset)) offset_ = offset*type_size
1334 call cuda_mem_set_async(buffer%mem, val, nval_, offset_)
1335 if(.not. optional_default(async, .false.))
call accel_finish()
1344 type(type_t),
intent(in) :: type
1345 integer(int64),
intent(in) :: nval
1346 integer(int64),
optional,
intent(in) :: offset
1347 logical,
optional,
intent(in) :: async
1360 type(type_t),
intent(in) :: type
1361 integer(int32),
intent(in) :: nval
1362 integer(int32),
optional,
intent(in) :: offset
1363 logical,
optional,
intent(in) :: async
1367 if (
present(offset))
then
1380 integer,
parameter :: times = 10
1382 real(real64) :: time, stime
1383 real(real64) :: read_bw, write_bw
1385 real(real64),
allocatable :: data(:)
1387 call messages_new_line()
1388 call messages_write(
'Info: Benchmarking the bandwidth between main memory and device memory')
1389 call messages_new_line()
1390 call messages_info()
1392 call messages_write(
' Buffer size Read bw Write bw')
1393 call messages_new_line()
1394 call messages_write(
' [MiB] [MiB/s] [MiB/s]')
1395 call messages_info()
1399 safe_allocate(
data(1:size))
1402 stime = loct_clock()
1407 time = (loct_clock() - stime)/real(times, real64)
1409 write_bw = real(
size, real64) *8.0_real64/time
1411 stime = loct_clock()
1417 time = (loct_clock() - stime)/real(times, real64)
1418 read_bw = real(
size, real64) *8.0_real64/time
1420 call messages_write(size*8.0_real64/1024.0_real64**2)
1421 call messages_write(write_bw/1024.0_real64**2, fmt =
'(f10.1)')
1422 call messages_write(read_bw/1024.0_real64**2, fmt =
'(f10.1)')
1423 call messages_info()
1427 safe_deallocate_a(data)
1429 size = int(size*2.0)
1431 if (
size > 50000000)
exit
1443 call cuda_program_map_init(
accel%program_map)
1484 'batch_axpy_function<double, DimSpin::D1>')
1486 'batch_axpy_function<double, DimSpin::D2>')
1488 'batch_axpy_function<complex<double>, DimSpin::D1>')
1490 'batch_axpy_function<complex<double>, DimSpin::D2>')
1492 'batch_axpy_function<float, DimSpin::D1>')
1494 'batch_axpy_function<float, DimSpin::D2>')
1496 'batch_axpy_function<complex<float>, DimSpin::D1>')
1498 'batch_axpy_function<complex<float>, DimSpin::D2>')
1500 'batch_ax_function_py<double, DimSpin::D1>')
1502 'batch_ax_function_py<double, DimSpin::D2>')
1504 'batch_ax_function_py<complex<double>, DimSpin::D1>')
1506 'batch_ax_function_py<complex<double>, DimSpin::D2>')
1508 'batch_ax_function_py<float, DimSpin::D1>')
1510 'batch_ax_function_py<float, DimSpin::D2>')
1512 'batch_ax_function_py<complex<float>, DimSpin::D1>')
1514 'batch_ax_function_py<complex<float>, DimSpin::D2>')
1518 call accel_program_add(
'batch_mul.cu',
'mul_batch<complex<double>, Conjugation::No>')
1519 call accel_program_add(
'batch_mul.cu',
'mul_batch<complex<double>, Conjugation::Yes>')
1520 call accel_program_add(
'batch_mul.cu',
'mul_mf<complex<double>, double, Conjugation::No>')
1521 call accel_program_add(
'batch_mul.cu',
'mul_mf<complex<double>, double, Conjugation::Yes>')
1522 call accel_program_add(
'batch_mul.cu',
'mul_mf<complex<double>, complex<double>, Conjugation::No>')
1523 call accel_program_add(
'batch_mul.cu',
'mul_mf<complex<double>, complex<double>, Conjugation::Yes>')
1528 call accel_program_add(
'boundaries.cu',
'boundaries_periodic_recv_corr<double>')
1547 'dftu_pos_mat_elem<double, double, Indexing::Indirect>')
1549 'dftu_pos_mat_elem<double, complex<double>, Indexing::Indirect>')
1551 'dftu_pos_mat_elem<double, complex<double>, Indexing::Direct>')
1554 'dftu_pos_mat_elem<double, double, Indexing::Direct>')
1556 'dftu_projector_bra<double>')
1558 'dftu_projector_bra<complex<double>>')
1560 'dftu_projector_bra_submesh<complex<double>>')
1562 'dftu_projector_bra_submesh<double>')
1564 'dftu_projector_ket<double>')
1566 'dftu_projector_ket<complex<double>>')
1568 'dftu_projector_ket_submesh<complex<double>>')
1570 'dftu_projector_ket_submesh<double>')
1573 'exchange_accumulate_batch<double, double, DimSpin::D1>')
1575 'exchange_accumulate_return_batch<double, double, DimSpin::D1>')
1577 'exchange_codensity_batch<double, DimSpin::D1>')
1579 'exchange_accumulate_batch<double, double, DimSpin::D2>')
1581 'exchange_accumulate_return_batch<double, double, DimSpin::D2>')
1583 'exchange_codensity_batch<double, DimSpin::D2>')
1585 'exchange_accumulate_batch<double, complex<double>, DimSpin::D1>')
1587 'exchange_accumulate_return_batch<double, complex<double>, DimSpin::D1>')
1589 'exchange_codensity_batch<complex<double>, DimSpin::D1>')
1591 'exchange_accumulate_batch<double, complex<double>, DimSpin::D2>')
1593 'exchange_accumulate_return_batch<double, complex<double>, DimSpin::D2>')
1595 'exchange_codensity_batch<complex<double>, DimSpin::D2>')
1597 'exchange_codensity_batch<float, DimSpin::D1>')
1599 'exchange_codensity_batch<float, DimSpin::D2>')
1601 'exchange_codensity_batch<complex<float>, DimSpin::D1>')
1603 'exchange_codensity_batch<complex<float>, DimSpin::D2>')
1605 'exchange_accumulate_batch<float, float, DimSpin::D1>')
1607 'exchange_accumulate_return_batch<float, float, DimSpin::D1>')
1609 'exchange_accumulate_batch<float, float, DimSpin::D2>')
1611 'exchange_accumulate_return_batch<float, float, DimSpin::D2>')
1613 'exchange_accumulate_batch<float, complex<float>, DimSpin::D1>')
1615 'exchange_accumulate_return_batch<float, complex<float>, DimSpin::D1>')
1617 'exchange_accumulate_batch<float, complex<float>, DimSpin::D2>')
1619 'exchange_accumulate_return_batch<float, complex<float>, DimSpin::D2>')
1622 call accel_program_add(
'forces.cu',
'density_gradient<double, complex<double>>')
1632 'batch_dotpv_reduce<double, double, DimSpin::D1>')
1634 'batch_dotpv_reduce<double, double, DimSpin::D2>')
1636 'batch_mf_dotp<double, DimSpin::D1>')
1638 'batch_mf_dotp<double, DimSpin::D2>')
1639 call accel_program_add(
'mesh_batch_single.cu',
'batch_dotpv_partial<complex<double>>')
1641 'batch_dotpv_reduce<double, complex<double>, DimSpin::D1>')
1643 'batch_dotpv_reduce<double, complex<double>, DimSpin::D2>')
1645 'batch_mf_dotp<complex<double>, DimSpin::D1>')
1647 'batch_mf_dotp<complex<double>, DimSpin::D2>')
1650 'mesh_interpolate<double, double, Dim::D1>')
1652 'mesh_interpolate<double, double, Dim::D2>')
1654 'mesh_interpolate<double, double, Dim::D3>')
1656 'mesh_interpolate<double, complex<double>, Dim::D1>')
1658 'mesh_interpolate<double, complex<double>, Dim::D2>')
1660 'mesh_interpolate<double, complex<double>, Dim::D3>')
1664 call accel_program_add(
'mesh_to_cube.cu',
'cube_to_mesh_batch<complex<double>>')
1665 call accel_program_add(
'mesh_to_cube.cu',
'mesh_to_cube_batch<complex<double>>')
1683 call accel_program_add(
'operate.cu',
'operate_map<double, Indexing::Direct, Symmetry::Antisymmetric>')
1684 call accel_program_add(
'operate.cu',
'operate_map<double, Indexing::Direct, Symmetry::Symmetric>')
1685 call accel_program_add(
'operate.cu',
'operate_map<double, Indexing::Indirect, Symmetry::Antisymmetric>')
1686 call accel_program_add(
'operate.cu',
'operate_map<double, Indexing::Indirect, Symmetry::Symmetric>')
1721 'precision_copy<complex<double>, complex<float>>')
1723 'precision_copy<complex<float>, complex<double>>')
1726 call accel_program_add(
'projector.cu',
'projector_bra_force_phase<double, double>')
1729 call accel_program_add(
'projector.cu',
'projector_ket_phase_spiral<double, double>')
1732 call accel_program_add(
'projector.cu',
'projector_r_vnl_bra_phase<double, double>')
1734 call accel_program_add(
'projector.cu',
'projector_r_vnl_ket_phase<double, double>')
1735 call accel_program_add(
'projector.cu',
'projector_bra_phase_spiral_gather_all<double>')
1736 call accel_program_add(
'projector.cu',
'projector_bra_force<double, complex<double>>')
1737 call accel_program_add(
'projector.cu',
'projector_bra_force_phase<double, complex<double>>')
1739 call accel_program_add(
'projector.cu',
'projector_ket_phase<double, complex<double>>')
1740 call accel_program_add(
'projector.cu',
'projector_ket_phase_spiral<double, complex<double>>')
1742 call accel_program_add(
'projector.cu',
'projector_r_vnl_bra<double, complex<double>>')
1743 call accel_program_add(
'projector.cu',
'projector_r_vnl_bra_phase<double, complex<double>>')
1744 call accel_program_add(
'projector.cu',
'projector_r_vnl_ket<double, complex<double>>')
1745 call accel_program_add(
'projector.cu',
'projector_r_vnl_ket_phase<double, complex<double>>')
1747 call accel_program_add(
'projector.cu',
'projector_bra_gather_all<complex<double>>')
1748 call accel_program_add(
'projector.cu',
'projector_bra_phase_gather_all<double>')
1749 call accel_program_add(
'projector.cu',
'projector_bra_scatter_all<double, double>')
1750 call accel_program_add(
'projector.cu',
'projector_bra_scatter_all<double, complex<double>>')
1751 call accel_program_add(
'projector.cu',
'projector_bra_scatter_complex_all<double, complex<double>>')
1753 call accel_program_add(
'projector_commutator.cu',
'projector_commutator_bra<double, double>')
1754 call accel_program_add(
'projector_commutator.cu',
'projector_commutator_bra_phase<double, double>')
1755 call accel_program_add(
'projector_commutator.cu',
'projector_commutator_ket<double, double>')
1756 call accel_program_add(
'projector_commutator.cu',
'projector_commutator_ket_phase<double, double>')
1757 call accel_program_add(
'projector_commutator.cu',
'dprojector_mix_commutator<double>')
1758 call accel_program_add(
'projector_commutator.cu',
'projector_commutator_bra<double, complex<double>>')
1759 call accel_program_add(
'projector_commutator.cu',
'projector_commutator_bra_phase<double, complex<double>>')
1760 call accel_program_add(
'projector_commutator.cu',
'projector_commutator_ket<double, complex<double>>')
1761 call accel_program_add(
'projector_commutator.cu',
'projector_commutator_ket_phase<double, complex<double>>')
1762 call accel_program_add(
'projector_commutator.cu',
'zprojector_mix_commutator<double>')
1770 'symmetrizer_apply_single_batch<double, Conjugation::No>')
1772 'symmetrizer_apply_single_batch<double, Conjugation::Yes>')
1774 'symmetrizer_apply_single_batch<complex<double>, Conjugation::No>')
1776 'symmetrizer_apply_single_batch<complex<double>, Conjugation::Yes>')
1778 'symmetrizer_apply_single_batch<float, Conjugation::No>')
1780 'symmetrizer_apply_single_batch<float, Conjugation::Yes>')
1782 'symmetrizer_apply_single_batch<complex<float>, Conjugation::No>')
1784 'symmetrizer_apply_single_batch<complex<float>, Conjugation::Yes>')
1787 'uvw_to_xyz<double, Dim::D1, double*, int, double*, int>')
1789 'uvw_to_xyz<double, Dim::D2, double*, int, double*, int, double*, int, double*, int>')
1791 'uvw_to_xyz<double, Dim::D3, double*, int, double*, int, double*, int, double*, int, double*, int, double*, int>')
1812 character(len=*),
intent(in) :: file_name
1813 character(len=*),
intent(in) :: name
1817 call cuda_program_register(
accel%program_map, string_f_to_c(trim(file_name)), &
1818 string_f_to_c(trim(name)))
1831 if (.not.
associated(
head))
exit
1832 next_head =>
head%next
1838 call cuda_program_map_end(
accel%program_map)
1853 character(len=*),
intent(in) :: file_name
1854 character(len=*),
intent(in) :: kernel_name
1855 character(len=*),
optional,
intent(in) :: flags
1858 character(len=1000) :: all_flags
1863 call profiling_in(
"ACCEL_COMPILE", exclude = .
true.)
1866 all_flags =
'-I'//trim(conf%share)//
'/kernels/'//
" "//trim(
accel%debug_flag)
1868 if (
present(flags))
then
1869 all_flags = trim(all_flags)//
' '//trim(flags)
1872 call cuda_program_build(
accel%program_map,
accel%device%cuda_device, &
1873 string_f_to_c(trim(file_name)), string_f_to_c(trim(all_flags)))
1875 call cuda_program_get_kernel(this%cuda_kernel,
accel%program_map, &
1876 string_f_to_c(trim(file_name)), string_f_to_c(trim(all_flags)), &
1877 string_f_to_c(trim(kernel_name)))
1878 call cuda_alloc_arg_array(this%arguments)
1881 this%initialized = .
true.
1882 this%kernel_name = trim(kernel_name)
1884 call profiling_out(
"ACCEL_COMPILE")
1897 call cuda_free_arg_array(this%arguments)
1898 call cuda_release_kernel(this%cuda_kernel)
1902 this%initialized = .false.
1911 character(len=*),
intent(in) :: file_name
1912 character(len=*),
intent(in) :: kernel_name
1913 character(len=*),
optional,
intent(in) :: flags
1917 if (.not. this%initialized)
then
1930 size =
accel%global_memory_size
1938 size =
accel%shared_memory_size
1944 integer,
intent(in) :: dim
1949 if (dim == 1)
size = 2**30
1956 integer,
intent(in) :: stream_number
1962 call cuda_set_stream(
accel%cuda_stream, stream_number)
1965 call cublas_set_stream(
accel%cuda_stream, stream_number)
1975 integer,
intent(inout) :: stream_number
1981 call cuda_get_stream(stream_number)
1995 call cuda_synchronize_all_streams()
2003 type(c_ptr),
intent(in) :: buffer
2004 integer(int64),
intent(in) :: offset
2005 type(c_ptr) :: buffer_offset
2009 call cuda_get_pointer_with_offset(buffer, offset, buffer_offset)
2012 buffer_offset = buffer
2018 type(c_ptr),
intent(in) :: buffer
2019 integer(int64),
intent(in) :: offset
2020 type(c_ptr) :: buffer_offset
2024 call cuda_get_pointer_with_offset(buffer, 2_int64*offset, buffer_offset)
2027 buffer_offset = buffer
2033 type(c_ptr),
intent(in) :: buffer
2037 call cuda_clean_pointer(buffer)
2046 integer(int64),
intent(in) :: size
2047 integer(int64),
intent(out) :: grid_size
2048 integer(int64),
intent(out) :: thread_block_size
2051#ifdef __HIP_PLATFORM_AMD__
2054 thread_block_size =
size
2057 thread_block_size =
accel%warp_size
2064#include "accel_inc.F90"
2067#include "complex.F90"
2068#include "accel_inc.F90"
2071#include "real32.F90"
2072#include "accel_inc.F90"
2075#include "complex32.F90"
2076#include "accel_inc.F90"
2079#include "integer.F90"
2080#include "accel_inc.F90"
2083#include "integer8.F90"
2084#include "accel_inc.F90"
subroutine accel_grid_size_i4(n, blocksizes, gridsizes)
Computes the grid size for a given problem size and block size (32-bit version).
subroutine saccel_read_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine laccel_get_device_pointer_3l(host_pointer, device_pointer, dimensions)
subroutine caccel_read_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine caccel_write_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine zaccel_get_device_pointer_2l(host_pointer, device_pointer, dimensions)
subroutine, public accel_clean_pointer(buffer)
subroutine caccel_write_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine accel_kernel_global_end()
subroutine zaccel_write_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine, public accel_get_unfolded_size(size, grid_size, thread_block_size)
Get unfolded size: some kernels (e.g. projectors) unfold the array across warps as an optimization....
subroutine laccel_read_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine laccel_read_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine saccel_write_buffer_0_int32(this, n1, data, offset, async)
subroutine iaccel_write_buffer_2(this, n1, n2, data, offset, async)
subroutine accel_ensure_buffer_size_4(buffer, flags, type, required_size, set_zero, async)
pure logical function, public accel_allow_cpu_only()
subroutine caccel_get_device_pointer_2l(host_pointer, device_pointer, dimensions)
subroutine daccel_get_device_pointer_1(host_pointer, device_pointer, dimensions)
subroutine zaccel_read_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine caccel_read_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine daccel_read_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine zaccel_get_device_pointer_1(host_pointer, device_pointer, dimensions)
subroutine caccel_read_buffer_2(this, n1, n2, data, offset, async)
subroutine laccel_read_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine saccel_write_buffer_1(this, n1, data, offset, async)
subroutine saccel_write_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine daccel_write_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine laccel_write_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine caccel_write_buffer_2(this, n1, n2, data, offset, async)
subroutine saccel_write_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine daccel_write_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine saccel_write_buffer_2(this, n1, n2, data, offset, async)
subroutine caccel_read_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine laccel_get_device_pointer_1(host_pointer, device_pointer, dimensions)
subroutine zaccel_read_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine zaccel_read_buffer_0(this, n1, data, offset, async)
subroutine saccel_read_buffer_4(this, n1, n2, n3, n4, data, offset, async)
integer function, public accel_kernel_block_size(kernel)
subroutine saccel_read_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine zaccel_write_buffer_single(this, data, async)
subroutine daccel_read_buffer_2(this, n1, n2, data, offset, async)
subroutine iaccel_get_device_pointer_3l(host_pointer, device_pointer, dimensions)
subroutine zaccel_read_buffer_2(this, n1, n2, data, offset, async)
subroutine laccel_get_device_pointer_2(host_pointer, device_pointer, dimensions)
subroutine iaccel_write_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine zaccel_write_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine accel_grid_size_array_i8(n, blocksizes, gridsizes)
Computes the grid size for a given problem size and block size (64-bit version).
subroutine laccel_write_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine zaccel_read_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine iaccel_write_buffer_1(this, n1, data, offset, async)
subroutine laccel_write_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine, public accel_free_buffer(this, async)
subroutine saccel_get_device_pointer_1l(host_pointer, device_pointer, dimensions)
subroutine daccel_write_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine iaccel_write_buffer_0_int32(this, n1, data, offset, async)
subroutine, public accel_kernel_start_call(this, file_name, kernel_name, flags)
subroutine iaccel_write_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine zaccel_write_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine iaccel_read_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine saccel_set_kernel_arg_data(kernel, narg, data)
subroutine zaccel_write_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine, public accel_get_stream(stream_number)
subroutine accel_create_buffer_4(this, flags, type, size, set_zero, async)
subroutine caccel_set_kernel_arg_data(kernel, narg, data)
subroutine zaccel_read_buffer_1_int32(this, n1, data, offset, async)
subroutine iaccel_write_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
integer(int64) pure function, public accel_global_memory_size()
subroutine caccel_get_device_pointer_2(host_pointer, device_pointer, dimensions)
subroutine saccel_read_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine saccel_read_buffer_2(this, n1, n2, data, offset, async)
subroutine daccel_read_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine laccel_write_buffer_1(this, n1, data, offset, async)
subroutine caccel_write_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine saccel_read_buffer_1(this, n1, data, offset, async)
subroutine saccel_read_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine saccel_write_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine daccel_read_buffer_1(this, n1, data, offset, async)
subroutine daccel_write_buffer_2(this, n1, n2, data, offset, async)
subroutine zaccel_set_kernel_arg_data(kernel, narg, data)
subroutine daccel_get_device_pointer_3l(host_pointer, device_pointer, dimensions)
subroutine caccel_write_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine iaccel_read_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine daccel_get_device_pointer_2l(host_pointer, device_pointer, dimensions)
integer(int64) function accel_padded_size_i8(nn)
subroutine accel_check_bandwidth()
subroutine saccel_read_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine saccel_write_buffer_single(this, data, async)
subroutine iaccel_write_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine caccel_write_buffer_1(this, n1, data, offset, async)
subroutine daccel_read_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine caccel_read_buffer_1(this, n1, data, offset, async)
subroutine laccel_read_buffer_0(this, n1, data, offset, async)
subroutine caccel_write_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine daccel_write_buffer_0(this, n1, data, offset, async)
subroutine zaccel_read_buffer_0_int32(this, n1, data, offset, async)
subroutine iaccel_get_device_pointer_1l(host_pointer, device_pointer, dimensions)
subroutine, public accel_finish()
subroutine laccel_write_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine accel_kernel_global_init()
subroutine zaccel_read_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine daccel_read_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine accel_kernel_run_4(kernel, gridsizes, blocksizes, shared_memory_size)
Run a kernel with 4-byte integer sizes.
subroutine zaccel_write_buffer_1(this, n1, data, offset, async)
subroutine caccel_write_buffer_1_int32(this, n1, data, offset, async)
subroutine caccel_write_buffer_0_int32(this, n1, data, offset, async)
subroutine iaccel_get_device_pointer_1(host_pointer, device_pointer, dimensions)
subroutine laccel_read_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine, public accel_copy_buffer(dest, src, type, nval, offset_dest, offset_src, async)
Copy nval elements of the given type between two device buffers.
subroutine accel_grid_size_extend_dim_i4(n, pack_size, gridsizes, blocksizes, kernel)
Helper function to compute the grid for the kernels that relies on the batch size (pack_size) and the...
subroutine saccel_write_buffer_0(this, n1, data, offset, async)
subroutine accel_set_buffer_to(buffer, type, val, nval, offset, async)
subroutine, public accel_move_buffer(buffer_from, buffer_to)
Move the buffer memory from the first buffer to the second.
subroutine, public accel_detach_buffer(this)
Clear a buffer handle without freeing device memory.
subroutine saccel_read_buffer_1_int32(this, n1, data, offset, async)
subroutine laccel_set_kernel_arg_data(kernel, narg, data)
subroutine iaccel_write_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine daccel_write_buffer_1(this, n1, data, offset, async)
subroutine daccel_read_buffer_0_int32(this, n1, data, offset, async)
subroutine caccel_write_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine caccel_read_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine zaccel_read_buffer_1(this, n1, data, offset, async)
subroutine iaccel_write_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine daccel_read_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine laccel_write_buffer_single(this, data, async)
subroutine laccel_read_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine daccel_get_device_pointer_2(host_pointer, device_pointer, dimensions)
subroutine accel_kernel_run_8(kernel, gridsizes, blocksizes, shared_memory_size)
Run a kernel with 8-byte integer sizes.
subroutine iaccel_read_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine zaccel_write_buffer_0_int32(this, n1, data, offset, async)
subroutine zaccel_write_buffer_1_int32(this, n1, data, offset, async)
subroutine saccel_read_buffer_0(this, n1, data, offset, async)
subroutine saccel_read_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine accel_set_buffer_to_zero_i8(buffer, type, nval, offset, async)
subroutine zaccel_get_device_pointer_1l(host_pointer, device_pointer, dimensions)
logical pure function, public accel_buffer_is_allocated(this)
integer, parameter, public accel_mem_read_write
subroutine caccel_get_device_pointer_1l(host_pointer, device_pointer, dimensions)
subroutine accel_kernel_end(this)
subroutine caccel_read_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine laccel_write_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine zaccel_write_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine zaccel_get_device_pointer_2(host_pointer, device_pointer, dimensions)
subroutine caccel_write_buffer_single(this, data, async)
subroutine daccel_write_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine laccel_read_buffer_2_int32(this, n1, n2, data, offset, async)
type(c_ptr) function, public daccel_get_pointer_with_offset(buffer, offset)
subroutine iaccel_write_buffer_single(this, data, async)
subroutine iaccel_get_device_pointer_2(host_pointer, device_pointer, dimensions)
integer pure function, public accel_max_size_per_dim(dim)
subroutine zaccel_read_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine iaccel_read_buffer_0(this, n1, data, offset, async)
subroutine daccel_read_buffer_0(this, n1, data, offset, async)
subroutine iaccel_read_buffer_1_int32(this, n1, data, offset, async)
subroutine accel_grid_size_array_i4(n, blocksizes, gridsizes)
Computes the grid size for a given problem size and block size (32-bit version).
subroutine iaccel_read_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine caccel_read_buffer_0_int32(this, n1, data, offset, async)
subroutine laccel_write_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine laccel_write_buffer_0_int32(this, n1, data, offset, async)
subroutine saccel_get_device_pointer_2l(host_pointer, device_pointer, dimensions)
subroutine caccel_read_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine caccel_write_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine zaccel_write_buffer_2(this, n1, n2, data, offset, async)
subroutine laccel_read_buffer_0_int32(this, n1, data, offset, async)
subroutine saccel_write_buffer_1_int32(this, n1, data, offset, async)
subroutine laccel_get_device_pointer_2l(host_pointer, device_pointer, dimensions)
subroutine iaccel_get_device_pointer_3(host_pointer, device_pointer, dimensions)
subroutine zaccel_write_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine zaccel_write_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine saccel_write_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine saccel_get_device_pointer_3l(host_pointer, device_pointer, dimensions)
subroutine daccel_set_kernel_arg_data(kernel, narg, data)
subroutine iaccel_read_buffer_1(this, n1, data, offset, async)
subroutine accel_grid_size_extend_dim_i8(n, pack_size, gridsizes, blocksizes, kernel)
Helper function to compute the grid for the kernels that relies on the batch size (pack_size) and the...
subroutine caccel_get_device_pointer_3(host_pointer, device_pointer, dimensions)
subroutine, public accel_kernel_build(this, file_name, kernel_name, flags)
Compile the program that contains a given kernel.
subroutine, public accel_init(base_grp, namespace)
subroutine, public accel_end(namespace)
subroutine saccel_read_buffer_0_int32(this, n1, data, offset, async)
subroutine laccel_write_buffer_0(this, n1, data, offset, async)
subroutine daccel_write_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine saccel_write_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine zaccel_read_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine, public accel_synchronize_all_streams()
subroutine, public accel_set_stream(stream_number)
subroutine laccel_read_buffer_2(this, n1, n2, data, offset, async)
subroutine saccel_read_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine iaccel_read_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine saccel_get_device_pointer_3(host_pointer, device_pointer, dimensions)
subroutine iaccel_read_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine laccel_get_device_pointer_1l(host_pointer, device_pointer, dimensions)
subroutine iaccel_read_buffer_0_int32(this, n1, data, offset, async)
subroutine saccel_get_device_pointer_2(host_pointer, device_pointer, dimensions)
subroutine accel_grid_size_i8(n, blocksizes, gridsizes)
Computes the grid size for a given problem size and block size (64-bit version).
subroutine saccel_read_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine iaccel_write_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine caccel_read_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine caccel_get_device_pointer_1(host_pointer, device_pointer, dimensions)
subroutine caccel_get_device_pointer_3l(host_pointer, device_pointer, dimensions)
integer(int32) function accel_padded_size_i4(nn)
subroutine accel_set_buffer_to_zero_i4(buffer, type, nval, offset, async)
subroutine daccel_write_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine laccel_write_buffer_1_int32(this, n1, data, offset, async)
subroutine iaccel_get_device_pointer_2l(host_pointer, device_pointer, dimensions)
subroutine iaccel_write_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine saccel_write_buffer_4(this, n1, n2, n3, n4, data, offset, async)
pure logical function, public accel_is_enabled()
subroutine zaccel_read_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine daccel_write_buffer_0_int32(this, n1, data, offset, async)
subroutine saccel_write_buffer_3(this, n1, n2, n3, data, offset, async)
subroutine iaccel_write_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine daccel_write_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine iaccel_write_buffer_1_int32(this, n1, data, offset, async)
integer, parameter, public accel_mem_write_only
subroutine zaccel_write_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine daccel_read_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine caccel_write_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine laccel_write_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine laccel_read_buffer_1_int32(this, n1, data, offset, async)
subroutine daccel_read_buffer_1_int32(this, n1, data, offset, async)
subroutine laccel_read_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine daccel_write_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine daccel_get_device_pointer_1l(host_pointer, device_pointer, dimensions)
subroutine iaccel_read_buffer_2(this, n1, n2, data, offset, async)
subroutine laccel_write_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine laccel_write_buffer_2(this, n1, n2, data, offset, async)
subroutine daccel_write_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine laccel_write_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine zaccel_get_device_pointer_3(host_pointer, device_pointer, dimensions)
type(c_ptr) function, public zaccel_get_pointer_with_offset(buffer, offset)
subroutine iaccel_read_buffer_6_int32(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine saccel_get_device_pointer_1(host_pointer, device_pointer, dimensions)
subroutine laccel_read_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine daccel_write_buffer_single(this, data, async)
subroutine daccel_write_buffer_1_int32(this, n1, data, offset, async)
subroutine caccel_read_buffer_1_int32(this, n1, data, offset, async)
subroutine saccel_write_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine zaccel_write_buffer_0(this, n1, data, offset, async)
subroutine caccel_write_buffer_3_int32(this, n1, n2, n3, data, offset, async)
subroutine accel_ensure_buffer_size_8(buffer, flags, type, required_size, set_zero, async)
Grow a buffer to at least required_size elements, reusing it if it is already big enough.
type(accel_t), public accel
subroutine caccel_read_buffer_4(this, n1, n2, n3, n4, data, offset, async)
subroutine laccel_get_device_pointer_3(host_pointer, device_pointer, dimensions)
subroutine iaccel_read_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine caccel_read_buffer_0(this, n1, data, offset, async)
integer(int64) pure function, public accel_shared_memory_size()
integer pure function, public accel_max_block_size()
subroutine iaccel_set_kernel_arg_data(kernel, narg, data)
subroutine daccel_read_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine iaccel_read_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine iaccel_write_buffer_0(this, n1, data, offset, async)
subroutine zaccel_get_device_pointer_3l(host_pointer, device_pointer, dimensions)
subroutine saccel_write_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine accel_create_buffer_8(this, flags, type, size, set_zero, async)
subroutine laccel_read_buffer_1(this, n1, data, offset, async)
subroutine daccel_read_buffer_5_int32(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine daccel_read_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine caccel_write_buffer_0(this, n1, data, offset, async)
subroutine accel_program_add(file_name, name)
Register a kernel for later retrieval.
subroutine caccel_read_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine accel_set_kernel_arg_buffer(kernel, narg, buffer)
subroutine accel_kernel_list()
The kernels each source provides.
subroutine laccel_read_buffer_5(this, n1, n2, n3, n4, n5, data, offset, async)
subroutine zaccel_read_buffer_2_int32(this, n1, n2, data, offset, async)
subroutine zaccel_write_buffer_6(this, n1, n2, n3, n4, n5, n6, data, offset, async)
subroutine daccel_get_device_pointer_3(host_pointer, device_pointer, dimensions)
type(accel_kernel_t), pointer head
subroutine zaccel_read_buffer_4_int32(this, n1, n2, n3, n4, data, offset, async)
subroutine, public alloc_cache_put(alloc_cache, size, loc, put)
subroutine, public alloc_cache_get(alloc_cache, size, found, loc)
integer(int64), parameter, public alloc_cache_any_size
real(real64), parameter, public m_zero
System information (time, memory, sysname)
subroutine string_c_to_f(c_string, f_string)
convert a C string to a Fortran string
subroutine, public loct_sysname(name)
This module is intended to contain "only mathematical" functions and procedures.
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
character(len=512), private msg
subroutine, public messages_warning(no_lines, all_nodes, namespace)
subroutine, public messages_obsolete_variable(namespace, name, rep)
subroutine, public messages_new_line()
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
integer pure function, public types_get_size(this)
type(type_t), parameter, public type_none
This module defines the unit system, used for input and output.
type(unit_t), public unit_gigabytes
For larger amounts of data (natural code units are bytes)
type(unit_t), public unit_megabytes
For large amounts of data (natural code units are bytes)
type(unit_t), public unit_kilobytes
For small amounts of data (natural code units are bytes)