Skip to content

Commit

Permalink
Commenting.
Browse files Browse the repository at this point in the history
  • Loading branch information
insertinterestingnamehere committed Jun 11, 2021
1 parent 145fe77 commit 3f06692
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions benchmarks/sweeps/sweeps_numba_sgpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def unravel_4d_index(n0, n1, n2, n3, ix):
assert 0 <= i3 < n3
return i0, i1, i2, i3

# Sequential preprocessing run on CPU.
# Sequential preprocessing run on CPU to sort work items by DAG level.
@nb.jit(uint_t[:](float_t[:,:], uint_t, uint_t, uint_t, uint_t), nopython = True)
def generate_items(directions, nx, ny, nz, nd):
items = np.empty((nx * ny * nz * nd), uint_t_npy)
Expand Down Expand Up @@ -70,7 +70,6 @@ def compute_new_scattering(sigma_s, I, coefs, new_sigma):
num_dirs = I.shape[3]
num_groups = I.shape[4]
# TODO: Switch this over to scattering only between directions (like tycho 2 does) instead of being only between frequencies.
# TODO: Turn this into a cublas sgemmBatched call since cupy probably doesn't even call the right routine for this.
assert I.strides[3] == 4
assert new_sigma.strides[3] == 4
cublas_handle = cp.cuda.device.get_cublas_handle()
Expand All @@ -88,7 +87,7 @@ def compute_new_scattering(sigma_s, I, coefs, new_sigma):
strideB = 0
beta_block = np.array(0., 'f')
beta = beta_block.__array_interface__['data'][0]
ldc = num_dirs
ldc = num_dirs # doesn't matter since there's only one column here too.
strideC = num_dirs
batchCount = I.shape[2] - 2
for i in range(1, I.shape[0] - 1):
Expand Down Expand Up @@ -181,7 +180,6 @@ def sweep_step(work_items, tgroup_id, I, sigma, new_sigma, coefs, directions, si
# Sweep across the graph for the differencing scheme for the gradient.
chunk_size = 1024
num_blocks = (work_items.shape[0] + chunk_size - 1) // chunk_size
print(I.shape, sigma.shape)
compute_fluxes[num_blocks, chunk_size, 0, uint_t_nbytes](work_items, I, sigma, directions, sigma_a, sigma_s, tgroup_id)
# Compute the scattering terms in the collision operator.
compute_new_scattering(sigma_s, I, coefs, new_sigma)
Expand Down

0 comments on commit 3f06692

Please sign in to comment.