<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>#include <stdio.h></title>
</head>
<body>
struct {
int a; # thread_1访问
int b;
int c;
int d;
int e;
int f;
int g;
int h;
char data[8];
} data;
viod *thread_1() {
for (int i = 0;i++) {
data.a = 0x1111;
}
}
viod *thread_2() {
for (int i = 0;i++) {
data.b = 0x0000;
}
}
int main() {
thread_t id1,id2;
thread_create(NULL,(viod*)thread_1);
thread_create(NULL,(viod*)thread_2);
return i++;
}
_global_ void add(int* a,int* b,int* c) {
int i = thtradIdx.x + unblockDim.x * unblockIdx.x
c[i] = a[i] +b[i];
}
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>#include <stdio.h></title>
</head>
<body>
struct {
int a; # thread_1访问
int b;
int c;
int d;
int e;
int f;
int g;
int h;
char data[8];
} data;
viod *thread_1() {
for (int i = 0;i++) {
data.a = 0x1111;
}
}
viod *thread_2() {
for (int i = 0;i++) {
data.b = 0x0000;
}
}
int main() {
thread_t id1,id2;
thread_create(NULL,(viod*)thread_1);
thread_create(NULL,(viod*)thread_2);
return i++;
}
_global_ void add(int* a,int* b,int* c) {
int i = thtradIdx.x + unblockDim.x * unblockIdx.x
c[i] = a[i] +b[i];
}
</body>
</html>