File: ecm-gpu.h

package info (click to toggle)
gmp-ecm 7.0.4+ds-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,728 kB
  • sloc: asm: 36,431; ansic: 34,057; xml: 885; python: 799; sh: 698; makefile: 348
file content (55 lines) | stat: -rw-r--r-- 1,326 bytes parent folder | download | duplicates (2)
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
#ifndef _ECM_GPU_H
#define _ECM_GPU_H 1

#ifndef _DO_NOT_INCLUDE_ECM_IMPL_H
#include "ecm-impl.h"
#endif

#ifdef WITH_GPU

#ifndef ECM_GPU_NB_DIGITS
  #define ECM_GPU_NB_DIGITS 32 //by default
#endif

#ifndef ECM_GPU_DIGITS
  #define ECM_GPU_DIGITS 0
#endif

#if (ECM_GPU_DIGITS==0)
  #define ECM_GPU_SIZE_DIGIT 32
  typedef unsigned int digit_t;
  typedef int carry_t;
#endif

#define VOL volatile 
//#define VOL

#define ECM_GPU_CURVES_BY_BLOCK 32

#define ECM_GPU_MAX_BITS ECM_GPU_SIZE_DIGIT * ECM_GPU_NB_DIGITS
typedef digit_t VOL biguint_t[ECM_GPU_NB_DIGITS];
typedef carry_t VOL bigint_t[ECM_GPU_NB_DIGITS];

/* Uncomment the next line to print the number of remaining iterations. */
//#define PRINT_REMAINING_ITER
#endif

#ifndef _DO_NOT_INCLUDE_ECM_IMPL_H

/* cudawrapper.c */
#define gpu_ecm __ECM(gpu_ecm)
#ifdef WITH_GPU
int gpu_ecm (mpz_t, mpz_t, int*, mpz_t, mpz_t, mpz_t, double *, double, mpz_t,
             mpz_t, unsigned long, const int, int, int, int, int, int,
             FILE*, FILE*, char*, char *, double, int (*)(void), mpz_t, 
             double *, int, int*, unsigned int*);
#else
int gpu_ecm ();
#endif
#define gpu_ecm_stage1 __ECM(gpu_ecm_stage1)
int gpu_ecm_stage1 (mpz_t *, int *, mpz_t, mpz_t, unsigned int, unsigned int, 
                    float *, int);

#endif

#endif /* _ECM_GPU_H */