@@ -23,7 +23,7 @@ def get_config_var(name):
23
23
else :
24
24
ext = get_config_var ('SO' )
25
25
26
- fullpath = os .path .join (basedir , '_libsdm' + ext )
26
+ fullpath = os .path .join (basedir , '_libsdm' + ext )
27
27
if not os .path .isfile (fullpath ):
28
28
fullpath = os .path .join (basedir , '_libsdm.so' )
29
29
@@ -65,7 +65,7 @@ def _multK(value, K):
65
65
def opencl_worksize_mult16 (address_space ):
66
66
local_worksize = _multK (address_space .bs_len , 16 )
67
67
mcu = address_space .opencl_opts .max_compute_units
68
- global_worksize = _multK (address_space .sample // 20 , 2 * mcu * local_worksize )
68
+ global_worksize = _multK (address_space .sample // 20 , 2 * mcu * local_worksize )
69
69
return local_worksize , global_worksize
70
70
71
71
@@ -74,7 +74,7 @@ def opencl_worksize_power2(address_space):
74
74
while local_worksize < address_space .bs_len :
75
75
local_worksize *= 2
76
76
mcu = address_space .opencl_opts .max_compute_units
77
- global_worksize = _multK (address_space .sample // 20 , 2 * mcu * local_worksize )
77
+ global_worksize = _multK (address_space .sample // 20 , 2 * mcu * local_worksize )
78
78
return local_worksize , global_worksize
79
79
80
80
@@ -563,19 +563,19 @@ def write(self, addr, datum, radius=None, weight=1):
563
563
if isinstance (weight , int ):
564
564
libsdm .sdm_write2_weighted (pointer (self ), addr .bs_data , c_uint (radius ), datum .bs_data , c_int (weight ))
565
565
elif isinstance (weight , (list , tuple )):
566
- assert (self .bits + 1 == len (weight ))
566
+ assert (self .bits + 1 == len (weight ))
567
567
# See https://docs.python.org/3/library/ctypes.html#type-conversions
568
- weight_buf = (c_int * (self .bits + 1 ))(* weight )
568
+ weight_buf = (c_int * (self .bits + 1 ))(* weight )
569
569
libsdm .sdm_write2_weighted_table (pointer (self ), addr .bs_data , c_uint (radius ), datum .bs_data , weight_buf )
570
570
else :
571
571
raise NotImplemented
572
572
573
- #def write_sub(self, addr, datum, radius=None):
574
- # ''' Write a bitstring to the SDM.
575
- # '''
576
- # if radius is None:
577
- # radius = self.radius
578
- # libsdm.sdm_write_sub(pointer(self), addr.bs_data, c_uint(radius), datum.bs_data)
573
+ # def write_sub(self, addr, datum, radius=None):
574
+ # ''' Write a bitstring to the SDM.
575
+ # '''
576
+ # if radius is None:
577
+ # radius = self.radius
578
+ # libsdm.sdm_write_sub(pointer(self), addr.bs_data, c_uint(radius), datum.bs_data)
579
579
580
580
def write_random_bitstrings (self , n ):
581
581
for _ in range (n ):
0 commit comments