Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Comgr] Port get_data_isa_name_test from CTest to LIT#2750

Open
theSK2005 wants to merge 14 commits into
amd-stagingfrom
skushwah/lit_get_data_isa_name
Open

[Comgr] Port get_data_isa_name_test from CTest to LIT#2750
theSK2005 wants to merge 14 commits into
amd-stagingfrom
skushwah/lit_get_data_isa_name

Conversation

@theSK2005
Copy link
Copy Markdown

@theSK2005 theSK2005 commented Jun 1, 2026

Ports get_data_isa_name_test to LIT and splits into two separate tests, isa-enumeration and get-data-isa-name. Fixes Issue #2711.

Ports get_data_isa_name_test to LIT and splits into two separate tests, isa-enumeration and get-data-isa-name.
@theSK2005 theSK2005 added the comgr Related to Code Object Manager label Jun 1, 2026
Comment thread amd/comgr/test-lit/comgr-sources/shared.cl Outdated
Comment thread amd/comgr/test-lit/comgr-sources/get-data-isa-name.c Outdated
Comment thread amd/comgr/test-lit/comgr-sources/get-data-isa-name.c Outdated
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c Outdated
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c Outdated
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c Outdated
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c Outdated
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c
Comment thread amd/comgr/test-lit/comgr-sources/get-data-isa-name.c
Comment thread amd/comgr/test-lit/isa-enumeration.c Outdated
@lamb-j
Copy link
Copy Markdown
Collaborator

lamb-j commented Jun 1, 2026

Note: dropping of all the Comgr pipeline/compilation steps is intentional, as we already cover those in other tests (better for this test to be more focused)

Comment thread amd/comgr/test-lit/comgr-sources/get-data-isa-name.c Outdated
@lamb-j
Copy link
Copy Markdown
Collaborator

lamb-j commented Jun 1, 2026

Does the isa-enumeration test add value? I'm wondering if we should drop it completely.

The old test used amd_comgr_get_isa_name() to generate ISA names for the get_data_isa_name() testing. We could get fancy and do something similar:

// RUN: for isa in $(isa-enumeration); do
// RUN: gpu=${isa##*--};
// RUN: %clang -target amdgcn-amd-amdhsa -mcpu=$gpu -nogpulib -nogpuinc
// RUN: -c %S/comgr-sources/shared.cl -o %t.o &&
// RUN: get-data-isa-name %t.o $isa;
// RUN: done

Also, one thing we're missing: xnacx/sramecc coverage. We should add that as well

@theSK2005 theSK2005 requested a review from lamb-j June 1, 2026 20:25
Comment thread amd/comgr/test-lit/comgr-sources/common.h
Comment on lines +21 to +22
//strncpy(IsaName, Name, MAX_ISA_NAME_SIZE);
//printf("%s\n", IsaName);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

commented out code should be removed ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

please run patch through git-clang-format to clean up arbitrary trailing spaces

Comment thread amd/comgr/test-lit/comgr-sources/shared.cl Outdated

Size = setBuf(argv[1], &Buf);

amd_comgr_(create_data(AMD_COMGR_DATA_KIND_RELOCATABLE, &Data));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Need to check KIND_EXECUTABLE too

theSK2005 added 3 commits June 2, 2026 17:54
… added feature enumeration to isa-enumeration source. Now, running get-data-isa-name will iterate isa-enumeration over all features and then get-data-isa-name is called on each ISA and their respective valid features.
@theSK2005 theSK2005 requested review from chinmaydd and lamb-j June 2, 2026 23:00
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c Outdated
Comment thread amd/comgr/test-lit/comgr-sources/get-data-isa-name.c Outdated
Comment thread amd/comgr/test/get_data_isa_name_test.c
@@ -0,0 +1,10 @@
// COM: Test Comgr get_data_isa_name() API
// RUN: mapfile -t isa_arr < <(./isa-enumeration)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

mapfile is unlikely to be available on Windows. Ensure tests are compatible on both platforms

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Check other tests on how binaries are invoked

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How does this loop actually work ? Does it swallow errors in tests that isnt the last one ?

Can we figure out a way to do this across Windows and Linux ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The first line takes the stdout from isa-enumeration and treats it as stdin for mapfile. mapfile takes an stdin input and stores newline separated values in an array. Next line is for each on that isa_array. Then strip all elements in the isa name before -- to get the gpu name, etc. I think the easiest alternative would be to do all of the test in C++ and just call that test through LIT.

Comment thread amd/comgr/test-lit/comgr-sources/get-data-isa-name.c Outdated
Comment thread amd/comgr/test-lit/comgr-sources/gtgra.cl Outdated
@chinmaydd
Copy link
Copy Markdown

Branch has merge conflicts. rebase against amd-staging

Comment thread amd/comgr/test-lit/comgr-sources/testfn.cl Outdated
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c Outdated
Comment thread amd/comgr/test-lit/comgr-sources/get-data-isa-name.c
Comment thread amd/comgr/test-lit/comgr-sources/gtgra.cl Outdated
Comment thread amd/comgr/test-lit/get-data-isa-name.cl
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c
Comment thread amd/comgr/test-lit/comgr-sources/isa-enumeration.c Outdated
@theSK2005 theSK2005 requested review from chinmaydd and lamb-j June 3, 2026 20:27
@chinmaydd
Copy link
Copy Markdown

This branch has merge conflicts that need to be fixed before CI can run

Comment thread amd/comgr/test-lit/comgr-sources/get-data-isa-name.c Outdated
@theSK2005 theSK2005 requested a review from chinmaydd June 4, 2026 23:00
@chinmaydd
Copy link
Copy Markdown

Please resolve my comments on this thread : #2750 (comment)

@theSK2005
Copy link
Copy Markdown
Author

Please resolve my comments on this thread : #2750 (comment)

Understood, raised the review to make sure all the other issues have been addressed properly.

@chinmaydd
Copy link
Copy Markdown

chinmaydd commented Jun 4, 2026

Understood, raised the review to make sure all the other issues have been addressed properly.

Right, no problem. We usually try to address all posted review comments and then re-requesting reviews. Its a better use of reviewer context switch and reduces the back and forth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comgr Related to Code Object Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants