|
|
@@ -188,7 +188,8 @@ __device__ inline bool _gt(const unsigned int * x)
|
|
|
#define threadDimx 32
|
|
|
|
|
|
__global__ void cudaMulmod(GlobalThreadState *global_ts,
|
|
|
- unsigned int order_0, unsigned int order_1, unsigned int order_2)
|
|
|
+ unsigned int order_0, unsigned int order_1, unsigned int order_2,
|
|
|
+ unsigned int dpfreq)
|
|
|
// x <- x * y mod rho
|
|
|
{
|
|
|
CIOS_REG_DECLARE;
|
|
|
@@ -282,7 +283,7 @@ __global__ void cudaMulmod(GlobalThreadState *global_ts,
|
|
|
|
|
|
// Check for a distinguished point
|
|
|
asm("mov.u32 %0, $xr0;" : "=r" (xlow));
|
|
|
- if ((xlow & 0x000003ff) == 0 || !(order_2|order_1) && order_0 < (1<<20)) {
|
|
|
+ if (xlow <= dpfreq) {
|
|
|
unsigned int *ourbuffer = DPstreamAlloc();
|
|
|
if (ourbuffer) {
|
|
|
CIOS_WRITE_DP(ourbuffer, a_0, a_1, a_2, b_0, b_1, b_2);
|
|
|
@@ -307,7 +308,7 @@ int nthreads = 25600;
|
|
|
int nblocks = 50;
|
|
|
|
|
|
void cuda_dl(const ZZ_p &base, const ZZ_p &target, const ZZ &order,
|
|
|
- const ZZ &modulus, void *cbdata)
|
|
|
+ const ZZ &modulus, unsigned int dpfreq, void *cbdata)
|
|
|
{
|
|
|
unsigned long long totmicros = 0;
|
|
|
ZZ_pBak pbak;
|
|
|
@@ -468,7 +469,8 @@ void cuda_dl(const ZZ_p &base, const ZZ_p &target, const ZZ &order,
|
|
|
#endif
|
|
|
{
|
|
|
cerr << getpid() << " Launch " << ++launchcount << "...\n";
|
|
|
- cudaMulmod<<< nblocks, nthreads/nblocks /*tpb*/, 0 >>>(d_ts, order_0, order_1, order_2);
|
|
|
+ cudaMulmod<<< nblocks, nthreads/nblocks /*tpb*/, 0 >>>(d_ts,
|
|
|
+ order_0, order_1, order_2, dpfreq);
|
|
|
|
|
|
cudaThreadSynchronize();
|
|
|
checkCUDAError("kernel launch");
|