예제 #1
0
 def __init__(self, context, num_polarizations, tuning=None):
     self.context = context
     self.num_polarizations = num_polarizations
     # TODO: autotuning
     self.wgs = 256
     parameters = {'num_polarizations': num_polarizations, 'wgs': self.wgs}
     self.program = accel.build(
         context,
         "imager_kernels/grid_weights.mako",
         parameters,
         extra_dirs=[pkg_resources.resource_filename(__name__, '')])
예제 #2
0
 def __init__(self, context, tuning=None):
     self.context = context
     # TODO: autotuning
     self.wgs_x = 16
     self.wgs_y = 16
     parameters = {'wgs_x': self.wgs_x, 'wgs_y': self.wgs_y}
     self.program = accel.build(
         context,
         "imager_kernels/mean_weight.mako",
         parameters,
         extra_dirs=[pkg_resources.resource_filename(__name__, '')])
예제 #3
0
 def __init__(self, context, real_dtype, kernel_filename, tuning=None):
     self.real_dtype = np.dtype(real_dtype)
     self.wgs_x = 16  # TODO: autotuning
     self.wgs_y = 16
     self.program = accel.build(
         context, kernel_filename,
         {
             'real_type': katsdpimager.types.dtype_to_ctype(real_dtype),
             'wgs_x': self.wgs_x,
             'wgs_y': self.wgs_y,
         },
         extra_dirs=[pkg_resources.resource_filename(__name__, '')])
예제 #4
0
 def __init__(self, context, real_dtype, num_polarizations, tuning=None):
     if tuning is None:
         tuning = self.autotune(context, real_dtype, num_polarizations)
     self.wgs = tuning['wgs']
     self.real_dtype = real_dtype
     self.num_polarizations = num_polarizations
     params = {
         'real_type': types.dtype_to_ctype(real_dtype),
         'wgs': self.wgs,
         'num_polarizations': self.num_polarizations
     }
     self.program = accel.build(
         context, 'imager_kernels/predict.mako', params,
         extra_dirs=[pkg_resources.resource_filename(__name__, '')])
예제 #5
0
 def __init__(self, context, dtype, num_polarizations, tuning=None):
     # TODO: autotuning
     self.wgsx = 16
     self.wgsy = 16
     self.dtype = dtype
     self.num_polarizations = num_polarizations
     self.program = accel.build(
         context,
         "imager_kernels/clean/subtract_psf.mako", {
             'real_type': katsdpimager.types.dtype_to_ctype(dtype),
             'num_polarizations': num_polarizations,
             'wgsx': self.wgsx,
             'wgsy': self.wgsy
         },
         extra_dirs=[pkg_resources.resource_filename(__name__, '')])
예제 #6
0
 def __init__(self, context, dtype, tuning=None):
     # TODO: autotune
     self.wgs_x = 16
     self.wgs_y = 16
     self.dtype = np.dtype(dtype)
     parameters = {
         'wgs_x': self.wgs_x,
         'wgs_y': self.wgs_y,
         'real_type': katsdpimager.types.dtype_to_ctype(self.dtype)
     }
     self.program = accel.build(
         context,
         "imager_kernels/fourier_beam.mako",
         parameters,
         extra_dirs=[pkg_resources.resource_filename(__name__, '')])
예제 #7
0
 def __init__(self, context, dtype, num_polarizations, tuning=None):
     # TODO: autotuning
     self.context = context
     self.dtype = np.dtype(dtype)
     self.num_polarizations = num_polarizations
     self.wgsx = 16
     self.wgsy = 16
     self.program = accel.build(
         context, "imager_kernels/apply_primary_beam.mako",
         {
             'real_type': katsdpimager.types.dtype_to_ctype(dtype),
             'wgsx': self.wgsx,
             'wgsy': self.wgsy,
             'num_polarizations': num_polarizations
         },
         extra_dirs=[pkg_resources.resource_filename(__name__, '')])
예제 #8
0
 def __init__(self, context, dtype, num_polarizations, tuning=None):
     self.context = context
     self.dtype = np.dtype(dtype)
     self.num_polarizations = num_polarizations
     self.wgsx = 32
     self.wgsy = 8
     self.tilex = 32
     self.tiley = 32
     self.program = accel.build(
         context,
         "imager_kernels/clean/rank.mako", {
             'real_type': katsdpimager.types.dtype_to_ctype(dtype),
             'wgsx': self.wgsx,
             'wgsy': self.wgsy,
             'tilex': self.tilex,
             'tiley': self.tiley,
             'num_polarizations': num_polarizations
         },
         extra_dirs=[pkg_resources.resource_filename(__name__, '')])
예제 #9
0
 def __init__(self, context, dtype, num_polarizations, mode, tuning=None):
     # TODO: autotuning
     self.num_polarizations = num_polarizations
     self.dtype = dtype
     self.wgsx = 32
     self.wgsy = 8
     self.tilex = 32
     self.tiley = 32
     self.program = accel.build(
         context,
         "imager_kernels/clean/update_tiles.mako", {
             'real_type': katsdpimager.types.dtype_to_ctype(dtype),
             'wgsx': self.wgsx,
             'wgsy': self.wgsy,
             'tilex': self.tilex,
             'tiley': self.tiley,
             'num_polarizations': num_polarizations,
             'clean_mode': mode
         },
         extra_dirs=[pkg_resources.resource_filename(__name__, '')])
예제 #10
0
파일: sum.py 프로젝트: ska-sa/katsdpsigproc
 def __init__(self, context):
     self.wgs = 128
     self.program = build(context,
                          'sum.mako', {'wgs': self.wgs},
                          extra_dirs=[os.path.dirname(__file__)])
예제 #11
0
 def __init__(self, queue, size, scale):
     super().__init__(queue)
     program = build(queue.context, '', source=SOURCE)
     self.kernel = program.get_kernel('multiply')
     self.scale = np.float32(scale)
     self.slots['data'] = IOSlot((Dimension(size, self.WGS), ), np.float32)
예제 #12
0
 def __init__(self, context):
     self.program = build(context, '', source=SOURCE)
예제 #13
0
 def __init__(self, context, tuning=None):
     if tuning is None:
         tuning = self.autotune(context)
     self.wgs = tuning['wgs']
     self.program = build(context, '', source=SOURCE)