1
mirror of https://github.com/hashcat/hashcat synced 2024-11-24 14:27:14 +01:00
hashcat/OpenCL/inc_platform.h

38 lines
1.3 KiB
C
Raw Normal View History

2019-04-25 14:45:17 +02:00
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _INC_PLATFORM_H
2019-04-26 10:03:16 +02:00
#define _INC_PLATFORM_H
2019-04-25 14:45:17 +02:00
2019-06-20 10:04:31 +02:00
#ifdef IS_AMD
DECLSPEC u64x rotl64 (const u64x a, const int n);
DECLSPEC u64x rotr64 (const u64x a, const int n);
DECLSPEC u64 rotl64_S (const u64 a, const int n);
DECLSPEC u64 rotr64_S (const u64 a, const int n);
#endif
2019-04-25 14:45:17 +02:00
#ifdef IS_CUDA
DECLSPEC u32 atomic_dec (u32 *p);
DECLSPEC u32 atomic_inc (u32 *p);
DECLSPEC u32 atomic_or (u32 *p, u32 val);
2019-04-25 14:45:17 +02:00
DECLSPEC size_t get_global_id (const u32 dimindx __attribute__((unused)));
DECLSPEC size_t get_local_id (const u32 dimindx __attribute__((unused)));
DECLSPEC size_t get_local_size (const u32 dimindx __attribute__((unused)));
2019-05-08 20:42:46 +02:00
DECLSPEC u32x rotl32 (const u32x a, const int n);
DECLSPEC u32x rotr32 (const u32x a, const int n);
DECLSPEC u32 rotl32_S (const u32 a, const int n);
DECLSPEC u32 rotr32_S (const u32 a, const int n);
DECLSPEC u64x rotl64 (const u64x a, const int n);
DECLSPEC u64x rotr64 (const u64x a, const int n);
DECLSPEC u64 rotl64_S (const u64 a, const int n);
DECLSPEC u64 rotr64_S (const u64 a, const int n);
2019-05-06 14:34:16 +02:00
//#define rotate(a,n) (((a) << (n)) | ((a) >> (32 - (n))))
2019-04-25 14:45:17 +02:00
#define bitselect(a,b,c) ((a) ^ ((c) & ((b) ^ (a))))
#endif
#endif // _INC_PLATFORM_H