Skip to content

Commit

Permalink
Merge pull request #330 from szymonlopaciuk/fix_precompiled_kernel_test
Browse files Browse the repository at this point in the history
Fix the test of precompiled kernels
  • Loading branch information
giadarol authored Mar 22, 2023
2 parents e10f56b + faeecf8 commit f3a50e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_prebuild_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import cffi

import xobjects as xo
import xpart as xp
import xtrack as xt
from xtrack.prebuild_kernels import regenerate_kernels
Expand Down Expand Up @@ -55,7 +56,9 @@ def test_prebuild_kernels(mocker, tmp_path):
cffi_compile = mocker.patch.object(cffi.FFI, 'compile')

line = xt.Line(elements=[xt.Drift(length=2.0)])
line.build_tracker()

# Build the tracker on a fresh context, so that the kernel comes from a file
line.build_tracker(_context=xo.ContextCpu())

p = xp.Particles(p0c=1e9, px=3e-6)
line.track(p)
Expand Down

0 comments on commit f3a50e8

Please sign in to comment.