mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-06 04:09:33 +08:00
1fd508744e
Add support for gfx803 as an alias for fiji. Add test cases for all supported 'isa' values. gcc/ChangeLog: * config/gcn/gcn.cc (gcn_omp_device_kind_arch_isa): Add gfx803. * config/gcn/t-omp-device: Add gfx803. libgomp/ChangeLog: * testsuite/libgomp.c/declare-variant-4-fiji.c: New test. * testsuite/libgomp.c/declare-variant-4-gfx803.c: New test. * testsuite/libgomp.c/declare-variant-4-gfx900.c: New test. * testsuite/libgomp.c/declare-variant-4-gfx906.c: New test. * testsuite/libgomp.c/declare-variant-4-gfx908.c: New test. * testsuite/libgomp.c/declare-variant-4-gfx90a.c: New test. * testsuite/libgomp.c/declare-variant-4.h: New header file.
64 lines
917 B
C
64 lines
917 B
C
#pragma omp declare target
|
|
int
|
|
gfx803 (void)
|
|
{
|
|
return 0x803;
|
|
}
|
|
|
|
int
|
|
gfx900 (void)
|
|
{
|
|
return 0x900;
|
|
}
|
|
|
|
int
|
|
gfx906 (void)
|
|
{
|
|
return 0x906;
|
|
}
|
|
|
|
int
|
|
gfx908 (void)
|
|
{
|
|
return 0x908;
|
|
}
|
|
|
|
int
|
|
gfx90a (void)
|
|
{
|
|
return 0x90a;
|
|
}
|
|
|
|
#ifdef USE_FIJI_FOR_GFX803
|
|
#pragma omp declare variant(gfx803) match(device = {isa("fiji")})
|
|
#else
|
|
#pragma omp declare variant(gfx803) match(device = {isa("gfx803")})
|
|
#endif
|
|
#pragma omp declare variant(gfx900) match(device = {isa("gfx900")})
|
|
#pragma omp declare variant(gfx906) match(device = {isa("gfx906")})
|
|
#pragma omp declare variant(gfx908) match(device = {isa("gfx908")})
|
|
#pragma omp declare variant(gfx90a) match(device = {isa("gfx90a")})
|
|
int
|
|
f (void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
#pragma omp end declare target
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int v = 0;
|
|
|
|
#pragma omp target map(from : v)
|
|
v = f ();
|
|
|
|
if (v == 0)
|
|
__builtin_abort ();
|
|
|
|
__builtin_printf ("AMDGCN accelerator: gfx%x\n", v);
|
|
|
|
return 0;
|
|
}
|