Add explicit gfx1200/gfx1201 builds, runtime selection and per-target code objects. Guard staging, packaging and installation against mixed architectures; retain gfx1201 compatibility and strict K/M arithmetic. Adapt realdody's target configuration and MSVC binary16/BOOL portability fixes from ae530b0. Do not import its forced gfx12 layout on RDNA3. Add exhaustive binary16 and C++/PowerShell target contract regressions. Validation: 20 CTest gates on RX 9070 XT; four software-only gfx1200 gates; MSVC portability compile checks; exact 4K K async and M control outputs; isolated package install/restore and mixed-target rejection tests. No physical gfx1200 validation is claimed. Co-authored-by: realdody <[email protected]>
32 lines
1.5 KiB
C++
32 lines
1.5 KiB
C++
#include "gpu_target.h"
|
|
#include <cstdio>
|
|
|
|
int main(int argc, char** argv) {
|
|
using namespace d4r::diag;
|
|
try {
|
|
unsigned rejected = 0, objects = 0;
|
|
for (const char* target : {"gfx1200", "gfx1201"}) {
|
|
require_gpu_target(target, target);
|
|
require_gpu_target(std::string(target) + ":xnack-:sramecc-", target);
|
|
for (const char* invalid : {"gfx1101", "gfx12000", "gfx1202", "gfx1250", ""}) {
|
|
try { require_gpu_target(invalid, target); }
|
|
catch (const std::exception&) { ++rejected; continue; }
|
|
throw std::runtime_error("Invalid GPU target accepted");
|
|
}
|
|
}
|
|
for (int i = 1; i < argc; ++i) {
|
|
require_code_object_target(argv[i], D4R_TARGET_ARCH);
|
|
const auto other = std::string(D4R_TARGET_ARCH) == "gfx1201" ? "gfx1200" : "gfx1201";
|
|
try { require_code_object_target(argv[i], other); }
|
|
catch (const std::exception&) { ++rejected; ++objects; continue; }
|
|
throw std::runtime_error("Wrong code-object target accepted");
|
|
}
|
|
if (!objects) throw std::runtime_error("Supply actual compiled code objects");
|
|
std::printf("PASS GPU_TARGET_CONTRACT target=%s objects=%u rejected=%u hardware_executed=0\n",
|
|
D4R_TARGET_ARCH, objects, rejected);
|
|
return 0;
|
|
} catch (const std::exception& e) {
|
|
std::fprintf(stderr, "FAIL GPU_TARGET_CONTRACT %s\n", e.what()); return 5;
|
|
}
|
|
}
|