-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecordType.h
More file actions
125 lines (94 loc) · 3.07 KB
/
Copy pathrecordType.h
File metadata and controls
125 lines (94 loc) · 3.07 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//
// Created by adam on 6/30/19.
//
#ifndef CUDADB_RECORDTYPE_H
#define CUDADB_RECORDTYPE_H
#include <iostream>
#include <string>
#include <thrust/device_ptr.h>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/sort.h>
#include <thrust/copy.h>
#include "device_string.h"
using namespace std;
class recordType{
public:
device_string uin;
device_string country;
device_string province;
device_string city;
device_string gender;
int age;
device_string educationLevel;
device_string brand;
device_string model;
device_string networkOperator;
device_string networkType;
recordType(const device_string &uin, const device_string &country, const device_string &province,
const device_string &city, const device_string &gender, int age, const device_string &educationLevel,
const device_string &brand, const device_string &model, const device_string &networkOperator,
const device_string &networkType) : uin(uin), country(country), province(province), city(city),
gender(gender), age(age), educationLevel(educationLevel),
brand(brand), model(model), networkOperator(networkOperator),
networkType(networkType) {}
__host__ __device__
recordType() {
// denotes a failed recordType
age=-100;
}
__host__ __device__
recordType(const recordType & c):uin(c.uin), country(c.country), province(c.province), city(c.city),
gender(c.gender), age(c.age), educationLevel(c.educationLevel),
brand(c.brand), model(c.model), networkOperator(c.networkOperator),
networkType(c.networkType){}
__host__ __device__
const device_string &getUin() const {
return uin;
}
__host__ __device__
const device_string &getCountry() const {
return country;
}
__host__ __device__
const device_string &getProvince() const {
return province;
}
__host__ __device__
const device_string &getCity() const {
return city;
}
__host__ __device__
const device_string &getGender() const {
return gender;
}
__host__ __device__
int getAge() const {
return age;
}
__host__ __device__
const device_string &getEducationLevel() const {
return educationLevel;
}
__host__ __device__
const device_string &getBrand() const {
return brand;
}
__host__ __device__
const device_string &getModel() const {
return model;
}
__host__ __device__
const device_string &getNetworkOperator() const {
return networkOperator;
}
__host__ __device__
const device_string &getNetworkType() const {
return networkType;
}
__host__
string toString(){
return string("recordType: ") + std::string(uin);
}
};
#endif //CUDADB_RECORDTYPE_H