Skip to content

Commit

Permalink
Remove nomp_api_350.py and vxm_transform
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinarmtb committed Sep 26, 2023
1 parent 49f4ba9 commit e90da29
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
12 changes: 7 additions & 5 deletions tests/nomp-api-300-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ static int nomp_api_300_transpose(unsigned rows, unsigned cols) {
TOKEN_PASTE(nomp_api_300_multiply_aux, TEST_SUFFIX)
static int nomp_api_300_multiply_aux(const char *fmt, TEST_TYPE *a,
TEST_TYPE *b, TEST_TYPE *c, int n,
int a_size, int b_size,
const char *transform_name) {
int a_size, int b_size, const char *module,
const char *function) {
nomp_test_check(nomp_update(a, 0, a_size, sizeof(TEST_TYPE), NOMP_TO));
nomp_test_check(nomp_update(b, 0, b_size, sizeof(TEST_TYPE), NOMP_TO));
nomp_test_check(nomp_update(c, 0, b_size, sizeof(TEST_TYPE), NOMP_ALLOC));

int id = -1;
const char *clauses[4] = {"transform", "nomp_api_300", transform_name, 0};
const char *clauses[4] = {"transform", module, function, 0};
char *knl = generate_knl(fmt, 3, TOSTRING(TEST_TYPE), TOSTRING(TEST_TYPE),
TOSTRING(TEST_TYPE));
nomp_test_check(nomp_jit(&id, knl, clauses, 4, "a", sizeof(TEST_TYPE),
Expand Down Expand Up @@ -145,7 +145,8 @@ static int nomp_api_300_mxm(unsigned n) {
" } \n"
" } \n"
"} \n";
nomp_api_300_multiply_aux(knl_fmt, a, b, c, n, n * n, n * n, "mxm_transform");
nomp_api_300_multiply_aux(knl_fmt, a, b, c, n, n * n, n * n, "nomp_api_300",
"mxm_transform");

#if defined(TEST_TOL)
for (unsigned i = 0; i < n * n; i++)
Expand Down Expand Up @@ -181,7 +182,8 @@ static int nomp_api_300_vxm(unsigned n) {
" c[i] = dot; \n"
" } \n"
"} \n";
nomp_api_300_multiply_aux(knl_fmt, a, b, c, n, n * n, n, "vxm_transform");
nomp_api_300_multiply_aux(knl_fmt, a, b, c, n, n * n, n, "nomp_api_215",
"tile_outer");

#if defined(TEST_TOL)
for (unsigned i = 0; i < n; i++)
Expand Down
2 changes: 1 addition & 1 deletion tests/nomp-api-350-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static int nomp_api_350_for_loop_bounds(unsigned N) {
" a[i] = t; \n"
" } \n"
"} \n";
const char *clauses[4] = {"transform", "nomp_api_350", "transform", 0};
const char *clauses[4] = {"transform", "nomp_api_215", "tile_outer", 0};
nomp_api_350_aux(knl_fmt, clauses, a, b, N);

#if defined(TEST_TOL)
Expand Down
2 changes: 1 addition & 1 deletion tests/nomp_api_215.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Transform script for nomp-api-215 and nomp-api-240 """
""" Transform script for nomp-api-215 and nomp-api-240. """
import loopy as lp

LOOPY_LANG_VERSION = (2018, 2)
Expand Down
10 changes: 3 additions & 7 deletions tests/nomp_api_300.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
""" Transform script for nomp-api-300. """
import math

import loopy as lp
Expand All @@ -6,6 +7,7 @@


def madd_transform(knl, context):
"""Tile both the loops."""
block_size = int(
math.sqrt(min(1024, context["device::max_threads_per_block"]))
)
Expand All @@ -25,6 +27,7 @@ def madd_transform(knl, context):


def mxm_transform(knl, context):
"""Tile two outer loops and tag innermost loop as sequential."""
block_size = int(
math.sqrt(min(1024, context["device::max_threads_per_block"]))
)
Expand All @@ -42,10 +45,3 @@ def mxm_transform(knl, context):
},
)
return knl


def vxm_transform(knl, context):
block_size = min(512, context["device::max_threads_per_block"])
knl = lp.split_iname(knl, "i", block_size)
knl = lp.tag_inames(knl, {"i_outer": "g.0", "i_inner": "l.0", "j": "for"})
return knl
10 changes: 0 additions & 10 deletions tests/nomp_api_350.py

This file was deleted.

2 changes: 2 additions & 0 deletions tests/sem.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
""" Annotation script for the spectral element kernels. """
from typing import Dict

import loopy as lp
Expand All @@ -10,6 +11,7 @@ def annotate(
annotations: Dict[str, str],
context: Dict[str, str],
) -> lp.translation_unit.TranslationUnit:
"""Annotate the spectral element kernels based on domain knowledge."""
inames = knl.default_entrypoint.all_inames()
block_size = min(512, context["device::max_threads_per_block"])
dof_axis = 0
Expand Down

0 comments on commit e90da29

Please sign in to comment.