1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
writableTmpDirAsHomeHook,
# build-system
hatchling,
# dependencies
pytools,
pymbolic,
genpy,
numpy,
cgen,
islpy,
codepy,
colorama,
mako,
constantdict,
typing-extensions,
# optional-dependencies
pyopencl,
fparser,
ply,
}:
buildPythonPackage (finalAttrs: {
pname = "loopy";
version = "2025.2";
pyproject = true;
src = fetchFromGitHub {
owner = "inducer";
repo = "loopy";
tag = "v${finalAttrs.version}";
hash = "sha256-VgsUOMCIg61mYNDMcGpMs5I1CkobhUFVjoQFdD8Vchs=";
fetchSubmodules = true; # submodule at `loopy/target/c/compyte`
};
build-system = [ hatchling ];
nativeBuildInputs = [ writableTmpDirAsHomeHook ];
dependencies = [
pytools
pymbolic
genpy
numpy
cgen
islpy
codepy
colorama
mako
constantdict
typing-extensions
];
optional-dependencies = {
pyopencl = [
pyopencl
];
fortran = [
fparser
ply
];
};
pythonImportsCheck = [ "loopy" ];
# pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR
doCheck = false;
meta = {
description = "Code generator for array-based code on CPUs and GPUs";
homepage = "https://github.com/inducer/loopy";
changelog = "https://github.com/inducer/loopy/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ tomasajt ];
};
})
|