@@ -29,21 +29,21 @@ module pluto_module
2929 pluto_register_resource, &
3030 pluto_unregister_resource
3131use pluto_module_allocator, only : &
32- pluto_allocator
32+ pluto_allocator, &
33+ pluto_make_allocator_name, &
34+ pluto_make_allocator_type
3335use pluto_module_allocate_deallocate, only : &
3436 pluto_allocate, pluto_deallocate
37+ use pluto_module_scope, only : &
38+ pluto_scope_t
39+ use pluto_module_trace, only : &
40+ pluto_trace_t
3541
3642implicit none
3743private
3844
3945public :: pluto, pluto_memory_resource, pluto_allocator
4046
41- type :: pluto_trace_t
42- contains
43- procedure , nopass :: enable = > pluto_trace_enable
44- procedure , nopass :: enabled = > pluto_trace_enabled
45- end type
46-
4747type pluto_host_t
4848 integer :: dummy
4949contains
@@ -121,12 +121,6 @@ module pluto_module
121121
122122end type
123123
124- type pluto_scope_t
125- contains
126- procedure , nopass :: push = > pluto_scope_push
127- procedure , nopass :: pop = > pluto_scope_pop
128- end type
129-
130124type pluto_t
131125 type (pluto_host_t) :: host
132126 type (pluto_device_t) :: device
@@ -149,9 +143,9 @@ module pluto_module
149143 procedure , nopass :: device_pool_resource = > pluto_device_pool_resource
150144 procedure , nopass :: managed_pool_resource = > pluto_managed_pool_resource
151145
152- procedure , private :: make_allocator_type = > pluto_make_allocator_type
153- procedure , private :: make_allocator_name = > pluto_make_allocator_name
154- generic :: make_allocator = > make_allocator_type, make_allocator_name
146+ procedure , nopass, private :: pluto_make_allocator_type
147+ procedure , nopass, private :: pluto_make_allocator_name
148+ generic :: make_allocator = > pluto_make_allocator_type, pluto_make_allocator_name
155149
156150 procedure , private ,nopass :: reserve_int32 = > pluto_memory_pool_resource_reserve_int32
157151 procedure , private ,nopass :: reserve_int64 = > pluto_memory_pool_resource_reserve_int64
@@ -219,60 +213,6 @@ module pluto_module
219213
220214contains
221215
222-
223- subroutine pluto_scope_push ()
224- interface
225- subroutine c_pluto_scope_push () bind(c)
226- end subroutine
227- end interface
228- call c_pluto_scope_push()
229- end subroutine
230-
231- subroutine pluto_scope_pop ()
232- interface
233- subroutine c_pluto_scope_pop () bind(c)
234- end subroutine
235- end interface
236- call c_pluto_scope_pop()
237- end subroutine
238-
239- subroutine pluto_trace_enable (enable )
240- logical , optional :: enable
241- logical :: do_enable
242- interface
243- subroutine c_pluto_trace_enable (enable ) bind(c)
244- use iso_c_binding, only: c_int
245- integer (c_int), value :: enable
246- end subroutine
247- end interface
248- do_enable = .true.
249- if (present (enable)) then
250- do_enable = enable
251- endif
252- if (do_enable) then
253- call c_pluto_trace_enable(1_c_int )
254- else
255- call c_pluto_trace_enable(0_c_int )
256- endif
257- end subroutine
258-
259- function pluto_trace_enabled ()
260- logical :: pluto_trace_enabled
261- integer (c_int) :: enabled
262- interface
263- function c_pluto_trace_enabled () result(enabled) bind(c)
264- use iso_c_binding, only: c_int
265- integer (c_int) :: enabled
266- end function
267- end interface
268- enabled = c_pluto_trace_enabled()
269- if (enabled == 1 ) then
270- pluto_trace_enabled = .true.
271- else
272- pluto_trace_enabled = .false.
273- endif
274- end function
275-
276216function pluto_devices ()
277217 integer (c_int) :: pluto_devices
278218 interface
@@ -294,20 +234,6 @@ function pluto_device_make_allocator() result(allocator)
294234 allocator% memory_resource = pluto_device_get_default_resource()
295235end function
296236
297- function pluto_make_allocator_type (this , resource ) result(allocator)
298- class(pluto_t) :: this
299- type (pluto_allocator) :: allocator
300- type (pluto_memory_resource) :: resource
301- allocator% memory_resource% c_memory_resource = resource% c_memory_resource
302- end function
303-
304- function pluto_make_allocator_name (this , resource ) result(allocator)
305- class(pluto_t) :: this
306- type (pluto_allocator) :: allocator
307- character (len=* ), target , intent (in ) :: resource
308- allocator% memory_resource = pluto_get_registered_resource(resource)
309- end function
310-
311237subroutine pluto_allocate_int32_bounds_type (array , lbounds , ubounds , resource )
312238 integer (c_int32_t), pointer , intent (inout ) :: array(..)
313239 integer (c_int), intent (in ) :: lbounds(rank(array))
0 commit comments