Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,22 @@ jobs:
mine="${kept# }"
fi

# `tensorvia`: the package declares linux and windows only. Its CPU
# backend is AVX2 (`<immintrin.h>`), and the macOS runners are arm64,
# so the 0.3.1 tarball has no macOS table at all. Resolution refuses
# it naming the platform; the leg would only re-measure that.
if [ "${{ matrix.platform }}" = "macos" ]; then
kept=""
for m in $mine; do
case "$m" in
tensorvia)
echo "skipping '$m' on the macOS leg: the package has no macOS artifact" ;;
*) kept="$kept $m" ;;
esac
done
mine="${kept# }"
fi

echo "MEMBERS=$mine" >> "$GITHUB_ENV"
echo "shard ${{ matrix.shard }}/${{ matrix.shards }}: ${mine:-<none>}"

Expand Down
1 change: 1 addition & 0 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ members = [
"tests/examples/quill-module",
"tests/examples/mp-units-module",
"tests/examples/tinyhttps",
"tests/examples/tensorvia",
"tests/examples/usockets",
"tests/examples/opencl",
"tests/examples/sycl-runtime",
Expand Down
46 changes: 46 additions & 0 deletions pkgs/t/tensorvia.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-- aimol.tensorvia — C++23 module tensor library with CPU, Vulkan, CUDA and SYCL
-- backends (`import tensorvia;`).
--
-- Emitted by `mcpp emit xpkg` from the package's own manifest @ v0.3.2, then
-- hand-maintained: `name` is the single atomic segment with the namespace
-- beside it, `maintainers` stays here (mcpp.toml has no such key), and the
-- `mcpp` pointer is the literal path rather than a `*/` glob. Those edits are
-- deliberate, so the "AUTO-GENERATED / do not edit by hand" banner is not
-- carried on this file.
--
-- NO `macosx` TABLE. The CPU backend is AVX2 (`_simd_math.h` includes
-- `<immintrin.h>`), so the package's own `platforms` names linux and windows
-- only; 0.3.1 withdrew the macOS claim rather than publishing a tarball that
-- cannot compile on Apple silicon.
package = {
spec = "1",
namespace = "aimol",
name = "tensorvia",
description = "Tensorvia: C++23 module tensor library with CPU, Vulkan, CUDA and SYCL backends",
licenses = {"MIT"},
repo = "https://github.com/Aimol-l/Tensorvia",
type = "package",
maintainers = {"Aimol-l"},

extensions = {
autoupdate = {
tag = "v${version}",
url = "https://github.com/Aimol-l/Tensorvia/releases/download/${tag}/tensorvia-${version}.tar.gz",
},
},

xpm = {
linux = {
['0.3.2'] = { url = "https://github.com/Aimol-l/Tensorvia/releases/download/v0.3.2/tensorvia-0.3.2.tar.gz", sha256 = "f5170e419fa4b37a04f02fdd71d66332a83031c4b823f09128c0066f980b9cf5" },
},
windows = {
['0.3.2'] = { url = "https://github.com/Aimol-l/Tensorvia/releases/download/v0.3.2/tensorvia-0.3.2.tar.gz", sha256 = "f5170e419fa4b37a04f02fdd71d66332a83031c4b823f09128c0066f980b9cf5" },
},
},

-- Form A: the tarball carries the library's own manifest at its root;
-- modules, features and the build program are declared there. The release
-- asset is `git archive v0.3.2` with no `<repo>-<tag>/` wrap layer, so the
-- pointer is the literal path (same as gcc.libstdcxx).
mcpp = "mcpp.toml",
}
17 changes: 17 additions & 0 deletions tests/examples/tensorvia/mcpp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# aimol.tensorvia test project: the module imports, CPU tensors round-trip
# through ops, and reductions read back the scalar the API contract promises.
# No accelerator is selected here, so this member exercises exactly the CPU
# artifact an unqualified consumer gets; the device lanes need a GPU and their
# payloads stay unpulled in CI.
[package]
name = "tensorvia-tests"
version = "0.1.0"

[indices]
# A member-level [indices] REPLACES the inherited table: the root's `compat`
# alias cannot resolve `aimol.*`. Point the `aimol` alias at this repo instead
# (the same shape taskflow-module uses for `taskflow`).
aimol = { path = "../../.." }

[dev-dependencies]
aimol.tensorvia = "0.3.2"
35 changes: 35 additions & 0 deletions tests/examples/tensorvia/tests/smoke.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// aimol.tensorvia smoke: import the module, run CPU ops, and read back
// scalars. Every check can fail; a non-zero exit is the signal.
import std;
import tensorvia;

namespace {

int failures = 0;

void check(bool ok, std::string_view what) {
if (!ok) {
std::println("FAIL: {}", what);
++failures;
}
}

} // namespace

int main() {
const Tensor ones = ops::Ones({4, 4}, DataType::FLOAT32);
check(ops::Sum(ones).item<float>() == 16.0f, "Sum(Ones(4x4)) == 16");

const Tensor twos = ops::Add(ones, ones);
check(ops::Sum(twos).item<float>() == 32.0f, "Sum(Ones+Ones) == 32");

// Add(tensor, scalar) then Relu: the negative half clamps to zero.
const Tensor clamped = ops::Relu(ops::Add(ones, -3.0f));
check(ops::Sum(clamped).item<float>() == 0.0f, "Relu(1-3) == 0");

// The library's version constant reaches a string_view consumer.
check(!tensorvia::version.empty(), "version is non-empty");

std::println("tensorvia smoke: {} failures", failures);
return failures == 0 ? 0 : 1;
}
Loading