-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommon.hpp
More file actions
39 lines (33 loc) · 798 Bytes
/
Copy pathcommon.hpp
File metadata and controls
39 lines (33 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef __COMMON_HPP__
#define __COMMON_HPP__
#include <cuda.h>
#include <cuda_runtime.h>
enum Side {
WHITE, BLACK
};
#define OTHER(x) (x == WHITE? BLACK:WHITE)
#define MAX_NUM_MOVES 32
class Move {
public:
int x, y;
__host__ __device__ Move() {
this->x = -1;
this->y = -1;
}
__host__ __device__ Move(int x, int y) {
this->x = x;
this->y = y;
}
__host__ __device__ Move(const Move &m) {
this->x = m.x;
this->y = m.y;
}
__host__ __device__ bool operator==(const Move &other) const {
return this->x == other.x && this->y == other.y;
}
__host__ __device__ bool operator!=(const Move &other) const {
return !(*this == other);
}
__host__ __device__ ~Move() {}
};
#endif