Skip to content

Commit 837c7d5

Browse files
committed
GPU aspects
1 parent 8e845a2 commit 837c7d5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

xfields/beam_elements/waketracker/convolution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def _initialize_conv_data(self, _flatten=False, moments_data=None, beta0=None):
118118

119119
# only positive frequencies because we are using rfft
120120
phase_term = self._context.nparray_to_context_array(np.exp(
121-
1j * 2 * np.pi * np.arange(self._M_aux//2 + 1) *
122-
((self._N_S - 1) * self._N_aux + self._N_1) / self._M_aux))
121+
1j * 2 * np.pi * np.arange(int(self._M_aux)//2 + 1) *
122+
((int(self._N_S) - 1) * int(self._N_aux) + int(self._N_1)) / int(self._M_aux)))
123123

124124
else:
125125
raise NotImplementedError('Flattened wakes are not implemented yet')
@@ -253,7 +253,7 @@ def _build_z_wake(z_a, z_b, num_turns, n_aux, m_aux, circumference, dz,
253253

254254
z_c = z_a # For wakefield, z_c = z_a
255255
z_d = z_b # For wakefield, z_d = z_b
256-
z_wake = np.zeros((num_turns, m_aux))
256+
z_wake = np.zeros((int(num_turns), int(m_aux)))
257257
for tt in range(num_turns):
258258
z_a_turn = z_a + tt * circumference
259259
z_b_turn = z_b + tt * circumference

xfields/slicers/compressed_profile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def __init__(self,
119119

120120
self.moments_names = moments
121121

122-
self.xoinitialize(_N_T=_N_T,_first_target_slot=first_target_slot, _N_aux=_N_aux, num_turns=num_turns,
123-
data=(len(moments), num_turns, self._M_aux),
122+
self.xoinitialize(_N_T=int(_N_T),_first_target_slot=int(first_target_slot), _N_aux=int(_N_aux), num_turns=int(num_turns),
123+
data=(len(moments), int(num_turns), int(self._M_aux)),
124124
**kwargs)
125125

126126

xfields/slicers/uniform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def _reshape_for_multibunch(self, data):
348348
def _to_npbuffer(self):
349349
tmp_buffer = self._buffer.buffer[self._offset:
350350
self._offset + self._xobject._size]
351-
return self._context.nparray_from_context_array(tmp_buffer)
351+
return self._context.nparray_from_context_array(tmp_buffer).astype(np.int8)
352352

353353
@classmethod
354354
def _from_npbuffer(cls, buffer):

0 commit comments

Comments
 (0)