Skip to content

Commit

Permalink
Added --target option and logic for more complex scheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
braxtoncuneo committed Sep 7, 2023
1 parent e6b0e0a commit 4345c19
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 120 deletions.
16 changes: 12 additions & 4 deletions mcdc/adapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ def universal_arrays_inner (func):
# =============================================================================


SIMPLE_ASYNC = True

none_type = None
mcdc_type = None
state_spec = None
Expand All @@ -216,7 +218,8 @@ def universal_arrays_inner (func):
thread_gpu = None
particle_gpu = None
prep_gpu = None
step_gpu = None
step_async = None
find_cell_async = None



Expand All @@ -225,7 +228,7 @@ def gpu_forward_declare():
global none_type, mcdc_type, state_spec
global device_gpu, group_gpu, thread_gpu
global particle_gpu, particle_record_gpu
global step_gpu
global step_async, find_cell_async

none_type = numba.from_dtype(np.dtype([ ]))
mcdc_type = numba.from_dtype(type_.global_)
Expand All @@ -236,8 +239,10 @@ def gpu_forward_declare():

def step(prog: numba.uintp, P: particle_gpu):
pass
def find_cell(prog: numba.uintp, P: particle_gpu):
pass

step_gpu, = adapt.harm.RuntimeSpec.async_dispatch(step)
step_async, find_cell_async = adapt.harm.RuntimeSpec.async_dispatch(step,find_cell)


# =============================================================================
Expand Down Expand Up @@ -282,7 +287,10 @@ def add_active(particle,prog):
@for_gpu()
def add_active(particle,prog):
P = kernel.recordlike_to_particle(particle)
step_gpu(prog,P)
if SIMPLE_ASYNC:
step_async(prog,P)
else:
find_cell_async(prog,P)


@for_cpu()
Expand Down
Loading

0 comments on commit 4345c19

Please sign in to comment.