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 12 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 12 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
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 on lines -312 to -316
const char *V4Options[] = {"-mcode-object-version=4"};
size_t V4OptionsCount = sizeof(V4Options) / sizeof(V4Options[0]);

const char *V6Options[] = {"-mcode-object-version=6"};
size_t V6OptionsCount = sizeof(V6Options) / sizeof(V6Options[0]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Did we check for COV4 and COV6 ?

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.

What would this entail? Should the LIT test try to compile with COV4, COV6, and no COV flag for each .o and .so?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sure. Even though COV4 is deprecated, we'd probably like to check coverage until its support is entirely removed

@@ -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

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
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