Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (4)
......@@ -113,22 +113,22 @@ latest-python:
junit: report.xml
# Minimal tests in windows environment
minimal-windows:
stage: test
except:
variables:
- $ENABLE_NIGHTLY_BUILDS
tags:
- win
script:
- export NUM_CORES=$(nproc --all)
- export MPLBACKEND=Agg
- source /cygdrive/c/Users/build/Miniconda3/Scripts/activate
- source activate pystencils
- pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
- python -c "import numpy"
- pip install sympy==1.9
- py.test -v -m "not (notebook or longrun)"
#minimal-windows:
# stage: test
# except:
# variables:
# - $ENABLE_NIGHTLY_BUILDS
# tags:
# - win
# script:
# - export NUM_CORES=$(nproc --all)
# - export MPLBACKEND=Agg
# - source /cygdrive/c/Users/build/Miniconda3/Scripts/activate
# - source activate pystencils
# - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils
# - python -c "import numpy"
# - pip install sympy==1.9
# - py.test -v -m "not (notebook or longrun)"
minimal-sympy-master:
stage: test
......
......@@ -26,7 +26,6 @@ Examples:
import warnings
import numpy as np
import pystencils
# Optional packages cpuinfo, cupy and psutil for hardware queries
try:
......@@ -36,19 +35,8 @@ except ImportError:
try:
import cupy
device = cupy.cuda.Device(pystencils.GPU_DEVICE)
except ImportError:
cupy = None
device = None
if cupy:
try:
device = cupy.cuda.Device(pystencils.GPU_DEVICE)
except AttributeError:
warnings.warn("You are using an old pystencils version. Consider updating it")
device = cupy.cuda.Device(0)
else:
device = None
try:
from psutil import virtual_memory
......@@ -125,9 +113,11 @@ def memory_sizes_of_current_machine():
if 'l3_cache_size' in cpu_info:
result['L3'] = cpu_info['l3_cache_size']
if device:
size = device.mem_info[1] / (1024 * 1024)
result['GPU'] = "{0:.0f} MB".format(size)
if cupy:
for i in range(cupy.cuda.runtime.getDeviceCount()):
device = cupy.cuda.Device(i)
size = device.mem_info[1] / (1024 * 1024)
result[f'GPU{i}'] = "{0:.0f} MB".format(size)
if virtual_memory:
mem = virtual_memory()
......
......@@ -17,5 +17,5 @@ def test_gpu_block_size_limiting():
kernel = ast.compile()
assert all(b < too_large for b in limited_block_size['block'])
bs = [too_large, too_large, too_large]
ast.indexing.limit_block_size_by_register_restriction(bs, kernel.num_regs)
bs = ast.indexing.limit_block_size_by_register_restriction(bs, kernel.num_regs)
assert all(b < too_large for b in bs)