mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
Rename d_side to d_left (to add d_right later)
This commit is contained in:
parent
f83e36d948
commit
3a3b3b33d1
@ -83,8 +83,8 @@ class Bilateral(Filter, ClsMod):
|
|||||||
fb.d_back, i32(pattern), i32(0), texrefs=[tref])
|
fb.d_back, i32(pattern), i32(0), texrefs=[tref])
|
||||||
grad_tref.set_address_2d(fb.d_back, grad_dsc, sb / 4)
|
grad_tref.set_address_2d(fb.d_back, grad_dsc, sb / 4)
|
||||||
launch2('den_blur_1c', self.mod, stream, dim,
|
launch2('den_blur_1c', self.mod, stream, dim,
|
||||||
fb.d_side, i32(pattern), i32(1), texrefs=[grad_tref])
|
fb.d_left, i32(pattern), i32(1), texrefs=[grad_tref])
|
||||||
grad_tref.set_address_2d(fb.d_side, grad_dsc, sb / 4)
|
grad_tref.set_address_2d(fb.d_left, grad_dsc, sb / 4)
|
||||||
|
|
||||||
launch2('bilateral', self.mod, stream, dim,
|
launch2('bilateral', self.mod, stream, dim,
|
||||||
fb.d_back, i32(pattern), i32(self.radius),
|
fb.d_back, i32(pattern), i32(self.radius),
|
||||||
@ -118,16 +118,16 @@ class HaloClip(Filter, ClsMod):
|
|||||||
|
|
||||||
set_blur_width(self.mod, fb.pool, stream=stream)
|
set_blur_width(self.mod, fb.pool, stream=stream)
|
||||||
launch2('apply_gamma', self.mod, stream, dim,
|
launch2('apply_gamma', self.mod, stream, dim,
|
||||||
fb.d_side, fb.d_front, f32(0.1))
|
fb.d_left, fb.d_front, f32(0.1))
|
||||||
tref.set_address_2d(fb.d_side, dsc, 4 * dim.astride)
|
tref.set_address_2d(fb.d_left, dsc, 4 * dim.astride)
|
||||||
launch2('den_blur_1c', self.mod, stream, dim,
|
launch2('den_blur_1c', self.mod, stream, dim,
|
||||||
fb.d_back, i32(2), i32(0), texrefs=[tref])
|
fb.d_back, i32(2), i32(0), texrefs=[tref])
|
||||||
tref.set_address_2d(fb.d_back, dsc, 4 * dim.astride)
|
tref.set_address_2d(fb.d_back, dsc, 4 * dim.astride)
|
||||||
launch2('den_blur_1c', self.mod, stream, dim,
|
launch2('den_blur_1c', self.mod, stream, dim,
|
||||||
fb.d_side, i32(3), i32(0), texrefs=[tref])
|
fb.d_left, i32(3), i32(0), texrefs=[tref])
|
||||||
|
|
||||||
launch2('haloclip', self.mod, stream, dim,
|
launch2('haloclip', self.mod, stream, dim,
|
||||||
fb.d_front, fb.d_side, gam)
|
fb.d_front, fb.d_left, gam)
|
||||||
|
|
||||||
def calc_lingam(params, tc):
|
def calc_lingam(params, tc):
|
||||||
gam = f32(1 / params.gamma(tc))
|
gam = f32(1 / params.gamma(tc))
|
||||||
@ -146,21 +146,21 @@ class SmearClip(Filter, ClsMod):
|
|||||||
|
|
||||||
set_blur_width(self.mod, fb.pool, params.width(tc), stream)
|
set_blur_width(self.mod, fb.pool, params.width(tc), stream)
|
||||||
launch2('apply_gamma_full_hi', self.mod, stream, dim,
|
launch2('apply_gamma_full_hi', self.mod, stream, dim,
|
||||||
fb.d_side, fb.d_front, f32(gam-1))
|
fb.d_left, fb.d_front, f32(gam-1))
|
||||||
tref.set_address_2d(fb.d_side, dsc, 16 * dim.astride)
|
tref.set_address_2d(fb.d_left, dsc, 16 * dim.astride)
|
||||||
launch2('full_blur', self.mod, stream, dim,
|
launch2('full_blur', self.mod, stream, dim,
|
||||||
fb.d_back, i32(2), i32(0), texrefs=[tref])
|
fb.d_back, i32(2), i32(0), texrefs=[tref])
|
||||||
tref.set_address_2d(fb.d_back, dsc, 16 * dim.astride)
|
tref.set_address_2d(fb.d_back, dsc, 16 * dim.astride)
|
||||||
launch2('full_blur', self.mod, stream, dim,
|
launch2('full_blur', self.mod, stream, dim,
|
||||||
fb.d_side, i32(3), i32(0), texrefs=[tref])
|
fb.d_left, i32(3), i32(0), texrefs=[tref])
|
||||||
tref.set_address_2d(fb.d_side, dsc, 16 * dim.astride)
|
tref.set_address_2d(fb.d_left, dsc, 16 * dim.astride)
|
||||||
launch2('full_blur', self.mod, stream, dim,
|
launch2('full_blur', self.mod, stream, dim,
|
||||||
fb.d_back, i32(0), i32(0), texrefs=[tref])
|
fb.d_back, i32(0), i32(0), texrefs=[tref])
|
||||||
tref.set_address_2d(fb.d_back, dsc, 16 * dim.astride)
|
tref.set_address_2d(fb.d_back, dsc, 16 * dim.astride)
|
||||||
launch2('full_blur', self.mod, stream, dim,
|
launch2('full_blur', self.mod, stream, dim,
|
||||||
fb.d_side, i32(1), i32(0), texrefs=[tref])
|
fb.d_left, i32(1), i32(0), texrefs=[tref])
|
||||||
launch2('smearclip', self.mod, stream, dim,
|
launch2('smearclip', self.mod, stream, dim,
|
||||||
fb.d_front, fb.d_side, f32(gam-1), lin, lingam)
|
fb.d_front, fb.d_left, f32(gam-1), lin, lingam)
|
||||||
|
|
||||||
@Filter.register('colorclip')
|
@Filter.register('colorclip')
|
||||||
class ColorClip(Filter, ClsMod):
|
class ColorClip(Filter, ClsMod):
|
||||||
|
@ -43,7 +43,7 @@ class Framebuffers(object):
|
|||||||
|
|
||||||
``d_front`` and ``d_back`` are separate buffers, each large enough to hold
|
``d_front`` and ``d_back`` are separate buffers, each large enough to hold
|
||||||
four float32 components per pixel (including any gutter pixels added for
|
four float32 components per pixel (including any gutter pixels added for
|
||||||
alignment or padding). ``d_side`` is another buffer large enough to hold
|
alignment or padding). ``d_left`` is another buffer large enough to hold
|
||||||
two float32 components per pixel.
|
two float32 components per pixel.
|
||||||
|
|
||||||
Every user of this set of buffers may use and overwrite the buffers in
|
Every user of this set of buffers may use and overwrite the buffers in
|
||||||
@ -101,14 +101,14 @@ class Framebuffers(object):
|
|||||||
self.d_points = cuda.mem_alloc(self._len_d_points)
|
self.d_points = cuda.mem_alloc(self._len_d_points)
|
||||||
|
|
||||||
def _clear(self):
|
def _clear(self):
|
||||||
self.nbins = self.d_front = self.d_back = self.d_side = self.d_uchar = None
|
self.nbins = self.d_front = self.d_back = self.d_left = self.d_uchar = None
|
||||||
|
|
||||||
def free(self, stream=None):
|
def free(self, stream=None):
|
||||||
if stream is not None:
|
if stream is not None:
|
||||||
stream.synchronize()
|
stream.synchronize()
|
||||||
else:
|
else:
|
||||||
cuda.Context.synchronize()
|
cuda.Context.synchronize()
|
||||||
for p in (self.d_front, self.d_back, self.d_side, self.d_uchar):
|
for p in (self.d_front, self.d_back, self.d_left, self.d_uchar):
|
||||||
if p is not None:
|
if p is not None:
|
||||||
p.free()
|
p.free()
|
||||||
self._clear()
|
self._clear()
|
||||||
@ -127,7 +127,7 @@ class Framebuffers(object):
|
|||||||
try:
|
try:
|
||||||
self.d_front = cuda.mem_alloc(16 * nbins)
|
self.d_front = cuda.mem_alloc(16 * nbins)
|
||||||
self.d_back = cuda.mem_alloc(16 * nbins)
|
self.d_back = cuda.mem_alloc(16 * nbins)
|
||||||
self.d_side = cuda.mem_alloc(16 * nbins)
|
self.d_left = cuda.mem_alloc(16 * nbins)
|
||||||
self.d_uchar = cuda.mem_alloc(nbins)
|
self.d_uchar = cuda.mem_alloc(nbins)
|
||||||
self.nbins = nbins
|
self.nbins = nbins
|
||||||
except cuda.MemoryError, e:
|
except cuda.MemoryError, e:
|
||||||
@ -309,7 +309,7 @@ class RenderManager(ClsMod):
|
|||||||
fill = lambda b, s, v=i32(0): util.fill_dptr(
|
fill = lambda b, s, v=i32(0): util.fill_dptr(
|
||||||
self.mod, b, s, stream=self.stream_a, value=v)
|
self.mod, b, s, stream=self.stream_a, value=v)
|
||||||
fill(self.fb.d_front, 4 * nbins)
|
fill(self.fb.d_front, 4 * nbins)
|
||||||
fill(self.fb.d_side, 4 * nbins)
|
fill(self.fb.d_left, 4 * nbins)
|
||||||
fill(self.fb.d_points, self.fb._len_d_points / 4, f32(np.nan))
|
fill(self.fb.d_points, self.fb._len_d_points / 4, f32(np.nan))
|
||||||
fill(self.fb.d_uchar, nbins / 4)
|
fill(self.fb.d_uchar, nbins / 4)
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ class RenderManager(ClsMod):
|
|||||||
def launch_iter(n):
|
def launch_iter(n):
|
||||||
if n == 0: return
|
if n == 0: return
|
||||||
launch('iter', rdr.mod, self.stream_a, (32, 8, 1), (nts, n),
|
launch('iter', rdr.mod, self.stream_a, (32, 8, 1), (nts, n),
|
||||||
self.fb.d_front, self.fb.d_side,
|
self.fb.d_front, self.fb.d_left,
|
||||||
self.fb.d_rb, self.fb.d_seeds, self.fb.d_points,
|
self.fb.d_rb, self.fb.d_seeds, self.fb.d_points,
|
||||||
self.fb.d_uchar, self.info_a.d_params)
|
self.fb.d_uchar, self.info_a.d_params)
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ class RenderManager(ClsMod):
|
|||||||
nblocks = int(np.ceil(np.sqrt(dim.ah*dim.astride/256.)))
|
nblocks = int(np.ceil(np.sqrt(dim.ah*dim.astride/256.)))
|
||||||
launch('flush_atom', self.mod, self.stream_a,
|
launch('flush_atom', self.mod, self.stream_a,
|
||||||
256, (nblocks, nblocks),
|
256, (nblocks, nblocks),
|
||||||
u64(self.fb.d_front), u64(self.fb.d_side), i32(nbins))
|
u64(self.fb.d_front), u64(self.fb.d_left), i32(nbins))
|
||||||
|
|
||||||
def queue_frame(self, rdr, gnm, gprof, tc, copy=True):
|
def queue_frame(self, rdr, gnm, gprof, tc, copy=True):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user