Révision 266
| Pi/XPU/PiXPU.py (revision 266) | ||
|---|---|---|
| 548 | 548 |
mf = cl.mem_flags |
| 549 | 549 |
|
| 550 | 550 |
circle=numpy.zeros(blocks*threads).astype(numpy.uint64) |
| 551 |
circleCL = cl.Buffer(ctx, mf.WRITE_ONLY|mf.COPY_HOST_PTR,hostbuf=circle) |
|
| 551 |
# circleCL = cl.Buffer(ctx, mf.WRITE_ONLY|mf.COPY_HOST_PTR,hostbuf=circle) |
|
| 552 |
circleCL = cl.Buffer(ctx, mf.WRITE_ONLY,circle.nbytes) |
|
| 552 | 553 |
|
| 553 | 554 |
MetropolisCL = cl.Program(ctx,KernelCodeOpenCL()).build( options = "-cl-mad-enable -cl-fast-relaxed-math -DTRNG=%i -DTYPE=%s -DTEST=%s" % (Marsaglia[RNG],Computing[ValueType],Test[TestType])) |
| 554 | 555 |
|
| Pi/XPU/PiXpuMPI.py (revision 266) | ||
|---|---|---|
| 288 | 288 |
NewIterations+=OutputCL['NewIterations'] |
| 289 | 289 |
Inside+=OutputCL['Inside'] |
| 290 | 290 |
|
| 291 |
print("Pi estimation %.8f" % (4./NewIterations*Inside))
|
|
| 292 |
|
|
| 293 |
Duration=numpy.append(Duration,time.time()-time_start) |
|
| 294 |
Rate=numpy.append(Rate,NewIterations/Duration[-1]) |
|
| 291 |
Duration=numpy.append(Duration,time.time()-time_start) |
|
| 292 |
Rate=numpy.append(Rate,NewIterations/Duration[-1]) |
|
| 293 |
print("Itops %i\nLogItops %.2f " % (int(Rate),numpy.log(Rate)/numpy.log(10)))
|
|
| 294 |
print("Pi estimation %.8f" % (4./NewIterations*Inside))
|
|
| 295 |
|
|
| 295 | 296 |
|
| 296 | 297 |
avgD=numpy.append(avgD,numpy.average(Duration)) |
| 297 | 298 |
medD=numpy.append(medD,numpy.median(Duration)) |
| Pi/XPU/PiXpuThreads.py (revision 266) | ||
|---|---|---|
| 276 | 276 |
OutputCL=MyThread.join() |
| 277 | 277 |
NewIterations+=OutputCL['NewIterations'] |
| 278 | 278 |
Inside+=OutputCL['Inside'] |
| 279 |
print("Pi estimation %.8f" % (4./NewIterations*Inside))
|
|
| 280 | 279 |
|
| 281 | 280 |
Duration=numpy.append(Duration,time.time()-time_start) |
| 282 | 281 |
Rate=numpy.append(Rate,NewIterations/Duration[-1]) |
| 282 |
print("Itops %i\nLogItops %.2f " % (int(Rate),numpy.log(Rate)/numpy.log(10)))
|
|
| 283 |
print("Pi estimation %.8f" % (4./NewIterations*Inside))
|
|
| 283 | 284 |
|
| 284 | 285 |
avgD=numpy.append(avgD,numpy.average(Duration)) |
| 285 | 286 |
medD=numpy.append(medD,numpy.median(Duration)) |
Formats disponibles : Unified diff