case omp_device_kind:
return strcmp (name, "cpu") == 0;
case omp_device_arch:
+#ifdef ACCEL_COMPILER
+ if (strcmp (name, "intel_mic") == 0)
+ return 1;
+#endif
if (strcmp (name, "x86") == 0)
return 1;
if (TARGET_64BIT)
omp-device-properties-i386: $(srcdir)/config/i386/i386-options.c
echo kind: cpu > $@
- echo arch: x86 x86_64 i386 i486 i586 i686 ia32 >> $@
+ echo arch: intel_mic x86 x86_64 i386 i486 i586 i686 ia32 >> $@
echo isa: sse4 `sed -n '/^static struct ix86_target_opts isa2\?_opts\[\] =/,/^};/p' \
$(srcdir)/config/i386/i386-options.c | \
sed -n 's/",.*$$//;s/^ { "-m//p'` >> $@
return [libgomp_check_effective_target_offload_target "amdgcn"]
}
-# Return 1 if compiling for offload target intelmic
-proc check_effective_target_offload_target_intelmic { } {
- return [libgomp_check_effective_target_offload_target "*-intelmic"]
-}
-
# Return 1 if offload device is available.
proc check_effective_target_offload_device { } {
return [check_runtime_nocache offload_device_available_ {
return [string match "nvidia" $openacc_device_type]
}
+# Return 1 if using Intel MIC offload device.
+proc check_effective_target_offload_device_intel_mic { } {
+ return [check_runtime_nocache offload_device_intel_mic {
+ #include <omp.h>
+ #include "testsuite/libgomp.c-c++-common/on_device_arch.h"
+ int main ()
+ {
+ return !on_device_arch_intel_mic ();
+ }
+ } ]
+}
+
# Return 1 if the OpenACC 'host' device type is selected.
proc check_effective_target_openacc_host_selected { } {
return GOMP_DEVICE_NVIDIA_PTX;
}
+/* static */ int
+device_arch_intel_mic (void)
+{
+ return GOMP_DEVICE_INTEL_MIC;
+}
+
#pragma omp declare variant (device_arch_nvptx) match(construct={target},device={arch(nvptx)})
+#pragma omp declare variant (device_arch_intel_mic) match(construct={target},device={arch(intel_mic)})
/* static */ int
device_arch (void)
{
{
return on_device_arch (GOMP_DEVICE_NVIDIA_PTX);
}
+
+int
+on_device_arch_intel_mic ()
+{
+ return on_device_arch (GOMP_DEVICE_INTEL_MIC);
+}
-/* { dg-do run { target { ! offload_target_intelmic } } } */
+/* { dg-xfail-run-if TODO { offload_device_intel_mic } } */
#include <omp.h>
#include <stdlib.h>
-! { dg-do run { target { ! offload_target_intelmic } } }
+! { dg-do run }
+! { dg-xfail-run-if TODO { offload_device_intel_mic } }
program main
use omp_lib