OmniSciDB
a5dc49c757
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
CompareKeysInl.h
Go to the documentation of this file.
1
/*
2
* Copyright 2022 HEAVY.AI, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#pragma once
18
19
#ifdef __CUDACC__
20
#include "
GpuRtConstants.h
"
21
#else
22
#include "
RuntimeFunctions.h
"
23
#endif // __CUDACC__
24
#include <cstdlib>
25
#include "../Shared/funcannotations.h"
26
27
template
<
typename
T =
int
64_t>
28
inline
DEVICE
T
SUFFIX
(
get_invalid_key
)() {
29
return
EMPTY_KEY_64
;
30
}
31
32
template
<>
33
inline
DEVICE
int32_t
SUFFIX
(
get_invalid_key
)() {
34
return
EMPTY_KEY_32
;
35
}
36
37
#ifdef __CUDACC__
38
template
<
typename
T>
39
inline
__device__
bool
keys_are_equal
(
const
T
* key1,
40
const
T
* key2,
41
const
size_t
key_component_count) {
42
for
(
size_t
i = 0; i < key_component_count; ++i) {
43
if
(key1[i] != key2[i]) {
44
return
false
;
45
}
46
}
47
return
true
;
48
}
49
#else
50
#include <cstring>
51
52
template
<
typename
T>
53
inline
bool
keys_are_equal
(
const
T
* key1,
54
const
T
* key2,
55
const
size_t
key_component_count) {
56
return
memcmp(key1, key2, key_component_count *
sizeof
(
T
)) == 0;
57
}
58
#endif // __CUDACC__
heavydb.dtypes.T
T
Definition:
dtypes.py:8
EMPTY_KEY_64
#define EMPTY_KEY_64
Definition:
GpuRtConstants.h:28
keys_are_equal
bool keys_are_equal(const T *key1, const T *key2, const size_t key_component_count)
Definition:
CompareKeysInl.h:53
SUFFIX
#define SUFFIX(name)
Definition:
funcannotations.h:71
RuntimeFunctions.h
DEVICE
#define DEVICE
Definition:
funcannotations.h:20
get_invalid_key
DEVICE T SUFFIX() get_invalid_key()
Definition:
CompareKeysInl.h:28
GpuRtConstants.h
EMPTY_KEY_32
#define EMPTY_KEY_32
Definition:
GpuRtConstants.h:29
QueryEngine
CompareKeysInl.h
Generated on Tue Aug 27 2024 00:12:40 for OmniSciDB by
1.8.5