ICOOOLPS update

This commit is contained in:
2026-06-29 16:31:43 +02:00
parent 48a9fe1187
commit f5a218b218
6 changed files with 101 additions and 8 deletions
+42
View File
@@ -0,0 +1,42 @@
struct point { float32 x; float32 y; }
float32 distance(const point &p1, const point &p2) {
float32 x1 = p1.x; float32 x2 = p2.x;
float32 y1 = p1.y; float32 y2 = p2.y;
float32 dx = (x2 - x1); float32 dy = (y2 - y1);
return sqrt(dx * dx + dy * dy);
}
point add(const point &p1, const point &p2) {
return new point(p1.x + p2.x, p1.y + p2.y);
}
point divide(const point &p, float32 div) {
if(div == 0.0f) return new point(0.0f, 0.0f); // edge case...
return new point(p.x / div, p.y / div);
}
type temp_center = pair<point, float32>;
pair<uint32, float32> mk_acc(uint32 idx, float32 dist) { return new pair<uint32, float32>(idx, dist); }
temp_center mk_temp_center(point p, float32 counter) { return new temp_center(p, counter); }
@Export
void kmeans(const vec<point> &points, vec<point> &centers) {
vec<temp_center> temp{centers.size()};
project p in points into temp {
pair<uint32, float32> acc;
@NoVectorize
accumulate (c, idx) in centers with mk_acc(0u, INF) into acc {
float32 dist = distance(p, c);
if(dist < acc.second) continue with mk_acc(idx, dist);
else continue;
}
uint32 closest_idx = acc.first;
continue[closest_idx] with (curr) -> mk_temp_center(add(p, curr.first), curr.second + 1.0f);
}
project c in temp into centers {
continue with divide(c.first, c.second);
}
}
+42
View File
@@ -0,0 +1,42 @@
// example 1: multiply by constant
@Export
void mul_by_5(vec<uint32> &xs) {
foreach x in xs {
// xs = new vec<uint32>(x);
// return;
// uint32 y = xs[x];
// if(x > 10u) continue;
continue with 5u * x;
}
}
// example 2: pairwise sum
@Export
vec<uint32> add(const vec<uint32> &xs, const vec<uint32> &ys) {
vec<uint32> out = new vec<uint32>(xs.size());
merge (x, y) in (xs, ys) into out {
continue with x + y;
}
return out;
}
// example 3: minimum
@Export
uint32 min_of(const vec<uint32> &xs) {
uint32 min;
accumulate x in xs with MAX_UINT32 into min {
continue with (x < min) ? x : min;
}
return min;
}
// example 4: counting
@Export
vec<uint32> count(const vec<uint32> &xs, uint32 max) {
vec<uint32> counters{max + 1u};
project x in xs into counters {
uint32 counter_idx = (x < max) ? x : max;
continue[counter_idx] with (curr) -> curr + 1u;
}
return counters;
}
Binary file not shown.
+11 -5
View File
@@ -225,12 +225,18 @@ Phoenix, a data-parallel programming language
<hr />
<h2 id="news">News</h2>
<ul>
<li><a
href="https://2026.ecoop.org/"><strong>ECOOP26</strong></a><br />
<li><a href="https://2026.ecoop.org"><strong>ECOOP26</strong></a><br />
<small>June 29 - July 3, 2026</small><br />
I will present a demo at <a
href="https://2026.ecoop.org/home/ICOOOLPS-2026">ICOOOLPS 2026</a> in
Brussels, and will stay to attend ECOOP.</li>
Im attending presentations and learning! Find me at ECOOP!<br />
</li>
<li><a href="https://2026.ecoop.org/home/ICOOOLPS-2026"><strong>ICOOOLPS
2026</strong></a><br />
<small>June 29, 2026</small><br />
I presented my demo at ICOOOLPS 2026 in Brussels. You can find the <a
href="./ecoop26/slides_icooolps.pdf">slides</a> and Phoenix code
examples (<a href="./ecoop26/mini-ex.phnx">1</a> <a
href="./ecoop26/kmeans.phnx">2</a>) at the links.<br />
</li>
<li><a
href="https://pliss.org/2025/"><strong>PLISS25</strong></a><br />
<small>May 26 - May 31, 2025</small><br />
+5 -2
View File
@@ -40,9 +40,12 @@ header-includes:
## News
- [**ECOOP'26**](https://2026.ecoop.org/)
- [**ECOOP'26**](https://2026.ecoop.org)
<small>June 29 - July 3, 2026</small>
I will present a demo at [ICOOOLPS 2026](https://2026.ecoop.org/home/ICOOOLPS-2026) in Brussels, and will stay to attend ECOOP.
I'm attending presentations and learning! Find me at ECOOP!
- [**ICOOOLPS 2026**](https://2026.ecoop.org/home/ICOOOLPS-2026)
<small>June 29, 2026</small>
I presented my demo at ICOOOLPS 2026 in Brussels. You can find the [slides](./ecoop26/slides_icooolps.pdf) and Phoenix code examples ([1](./ecoop26/mini-ex.phnx) [2](./ecoop26/kmeans.phnx)) at the links.
- [**PLISS'25**](https://pliss.org/2025/)
<small>May 26 - May 31, 2025</small>
I attended the summer school in Bertinoro! This was followed by a short trip to Firenze/Florence, Muenchen/Munich, and Ravenstein.
+1 -1
View File
@@ -1,3 +1,3 @@
#!/usr/bin/zsh
scp **/*.html **/*.css **/*.svg **/*.png **/*.jpg **/*.pdf jay@jaytux.com:/etc/jaytux.com/main/
rsync -Rt **/*.html **/*.css **/*.svg **/*.png **/*.jpg **/*.pdf **/*.phnx jay@jaytux.com:/etc/jaytux.com/main/