CombineHash
The function interface declaration is as follows:
HmppResult HMPPS_CombineHash(const int64_t *src1, const int64_t *src2, int32_t len, int64_t *dst);
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
src1 |
Pointer to the source vector |
The value cannot be NULL. |
Input |
src2 |
Pointer to the source vector |
The value cannot be NULL. |
Input |
len |
Vector length |
(0, INT_MAX] |
Input |
dst |
Pointer to the result |
The value cannot be NULL. |
Output |
Return Value
- Success: HMPP_STS_NO_ERR
- Failure: An error code is returned.
Error Codes
Error Code |
Description |
|---|---|
HMPP_STS_NULL_PTR_ERR |
The value of src1, src2, or dst is NULL. |
HMPP_STS_SIZE_ERR |
The value of len is less than or equal to 0. |
Example
#include <stdio.h>
#include "hmpp.h"
#define BUFFER_SIZE_T 10
int main() {
int64_t src1[BUFFER_SIZE_T] = {3, 6, 2, 8, 3, 15, 56, 31, 1, 23};
int64_t dst[BUFFER_SIZE_T] = {0};
int64_t src2[BUFFER_SIZE_T] = {33, 612, 224, 80, 3234, 150, 562, 311, 11, 232};
HmppResult result = HMPPS_CombineHash(src1, src2, BUFFER_SIZE_T, dst);
printf("result = %d\n", result);
if (result != HMPP_STS_NO_ERR) {
return 0;
}
for (int i = 0; i < BUFFER_SIZE_T; i++) {
printf("%d, ", dst[i]);
}
printf("\n");
}
Output:
result = 0 126, 798, 286, 328, 3327, 615, 2298, 1272, 42, 945,
Parent topic: Aggregate and Hash Algorithms