8#include "../../src/kmp_platform.h"
38#if KMP_ARCH_X86 || KMP_ARCH_X86_64
69 ret++; printf(
"Error bool_1_cas no-op: %d != %d\n", co, c1); }
70 if (
r) {
ret++; printf(
"Error bool_1_cas no-op ret: %d\n",
r); }
73 ret++; printf(
"Error bool_1_cas: %d != %d\n", co, c2); }
74 if (!
r) {
ret++; printf(
"Error bool_1_cas ret: %d\n",
r); }
78 ret++; printf(
"Error bool_2_cas no-op: %d != %d\n", so, s1); }
79 if (
r) {
ret++; printf(
"Error bool_2_cas no-op ret: %d\n",
r); }
82 ret++; printf(
"Error bool_2_cas: %d != %d\n", so, s2); }
83 if (!
r) {
ret++; printf(
"Error bool_2_cas ret: %d\n",
r); }
87 ret++; printf(
"Error bool_4_cas no-op: %d != %d\n", io, i1); }
88 if (
r) {
ret++; printf(
"Error bool_4_cas no-op ret: %d\n",
r); }
91 ret++; printf(
"Error bool_4_cas: %d != %d\n", io, i2); }
92 if (!
r) {
ret++; printf(
"Error bool_4_cas ret: %d\n",
r); }
96 ret++; printf(
"Error bool_8_cas no-op: %lld != %lld\n", lo, l1); }
97 if (
r) {
ret++; printf(
"Error bool_8_cas no-op ret: %d\n",
r); }
100 ret++; printf(
"Error bool_8_cas: %lld != %lld\n", lo, l2); }
101 if (!
r) {
ret++; printf(
"Error bool_8_cas ret: %d\n",
r); }
108 ret++; printf(
"Error val_1_cas no-op: %d != %d\n", co, c2); }
110 ret++; printf(
"Error val_1_cas no-op ret: %d != %d\n", cc, c2); }
113 ret++; printf(
"Error val_1_cas: %d != %d\n", co, c1); }
114 if (cc != c2) {
ret++; printf(
"Error val_1_cas ret: %d != %d\n", cc, c2); }
118 ret++; printf(
"Error val_2_cas no-op: %d != %d\n", so, s2); }
120 ret++; printf(
"Error val_2_cas no-op ret: %d != %d\n", sc, s2); }
123 ret++; printf(
"Error val_2_cas: %d != %d\n", so, s1); }
125 ret++; printf(
"Error val_2_cas ret: %d != %d\n", sc, s2); }
129 ret++; printf(
"Error val_4_cas no-op: %d != %d\n", io, i2); }
131 ret++; printf(
"Error val_4_cas no-op ret: %d != %d\n", ic, i2); }
134 ret++; printf(
"Error val_4_cas: %d != %d\n", io, i1); }
136 ret++; printf(
"Error val_4_cas ret: %d != %d\n", ic, i2); }
140 ret++; printf(
"Error val_8_cas no-op: %lld != %lld\n", lo, l2); }
142 ret++; printf(
"Error val_8_cas no-op ret: %lld != %lld\n", lc, l2); }
145 ret++; printf(
"Error val_8_cas: %lld != %lld\n", lo, l1); }
147 ret++; printf(
"Error val_8_cas ret: %lld != %lld\n", lc, l2); }
152 for (io = 0; io < 5; ++io) {
153 #pragma omp parallel num_threads(2) private(i2, ic, r)
155 if (omp_get_thread_num() == 0) {
157 #pragma omp atomic read
161 #pragma omp atomic read
169 #pragma omp atomic read
176 if (i0 != 6 || i1 != 5) {
178 printf(
"Error in parallel, %d != %d or %d != %d\n", i0, 6, i1, 5);
184 printf(
"Unsupported architecture, skipping test...\n");
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d
bool __kmpc_atomic_bool_4_cas(ident_t *loc, int gtid, int *x, int e, int d)
long long __kmpc_atomic_val_8_cas(ident_t *loc, int gtid, long long *x, long long e, long long d)
int __kmpc_atomic_val_4_cas(ident_t *loc, int gtid, int *x, int e, int d)
bool __kmpc_atomic_bool_8_cas(ident_t *loc, int gtid, long long *x, long long e, long long d)
short __kmpc_atomic_val_2_cas(ident_t *loc, int gtid, short *x, short e, short d)
bool __kmpc_atomic_bool_2_cas(ident_t *loc, int gtid, short *x, short e, short d)
char __kmpc_atomic_val_1_cas(ident_t *loc, int gtid, char *x, char e, char d)
bool __kmpc_atomic_bool_1_cas(ident_t *loc, int gtid, char *x, char e, char d)