Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Add smoke test to cover new runtime envar #1209

Open
wants to merge 2 commits into
base: aomp-dev
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include <omp.h>
#include <stdio.h>

int main() {
int N = 10;

int a[N];
int b[N];

int i;

for (i = 0; i < N; i++)
a[i] = 0;

for (i = 0; i < N; i++)
b[i] = i;

#pragma omp target parallel for
{
for (int j = 0; j < N; j++)
a[j] = b[j];
}

int rc = 0;
for (i = 0; i < N; i++)
if (a[i] != b[i]) {
rc++;
printf("Wrong value: a[%d]=%d\n", i, a[i]);
}

if (!rc)
printf("Success\n");

return rc;
}

/// CHECK: TARGET AMDGPU RTL --> AMDGPUMemoryManager threshhold was set to:
/// 1048576 B
18 changes: 18 additions & 0 deletions test/smoke-dev/rt-memory-threshold-env/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include ../../Makefile.defs

TESTNAME = AMDGPUMemoryManager_threshold_env
TESTSRC_MAIN = AMDGPUMemoryManager_threshold_env.c
TESTSRC_AUX =
TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX)
RUNENV += LIBOMPTARGET_DEBUG=1
RUNENV += OMPX_AMD_MEMORY_MANAGER_THRESHOLD_EXP_2=20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a comment specifying the relationship between this value "20" and the expected output value "1048576 B"?


RUNCMD = ./$(TESTNAME) 2>&1 | $(FILECHECK) $(TESTSRC_MAIN)

CLANG ?= clang
OMP_BIN = $(AOMP)/bin/$(CLANG)
CC = $(OMP_BIN) $(VERBOSE)
#-ccc-print-phases
#"-\#\#\#"

include ../Makefile.rules