Révision 221 TrouNoir/TrouNoir.py
TrouNoir.py (revision 221) | ||
---|---|---|
1 |
#!/usr/bin/env python3
|
|
1 |
#!/usr/bin/env python |
|
2 | 2 |
# |
3 | 3 |
# TrouNoir model using PyOpenCL |
4 | 4 |
# |
... | ... | |
14 | 14 |
# |
15 | 15 |
# Conversion in C done by Emmanuel Quemener in august 1997 |
16 | 16 |
# GPUfication in OpenCL under Python in july 2019 |
17 |
# GPUfication in CUDA under Python in august 2019 |
|
17 | 18 |
# |
18 | 19 |
# Thanks to : |
19 | 20 |
# |
... | ... | |
115 | 116 |
{ |
116 | 117 |
float flx; |
117 | 118 |
|
118 |
flx=exp(q*log(r/m))*pow(rf,4)*b*db*h; |
|
119 |
// flx=exp(q*log(r/m))*pow(rf,4)*b*db*h; |
|
120 |
flx=exp(q*log(r/m)+4.*log(rf))*b*db*h; |
|
119 | 121 |
return(flx); |
120 | 122 |
} |
121 | 123 |
|
... | ... | |
620 | 622 |
{ |
621 | 623 |
float flx; |
622 | 624 |
|
623 |
flx=exp(q*log(r/m))*pow(rf,4)*b*db*h; |
|
625 |
// flx=exp(q*log(r/m))*pow(rf,4)*b*db*h; |
|
626 |
flx=exp(q*log(r/m)+4.*log(rf))*b*db*h; |
|
624 | 627 |
return(flx); |
625 | 628 |
} |
626 | 629 |
|
... | ... | |
810 | 813 |
uint yi=(uint)(blockIdx.y*blockDim.y+threadIdx.y); |
811 | 814 |
uint sizex=(uint)gridDim.x*blockDim.x; |
812 | 815 |
uint sizey=(uint)gridDim.y*blockDim.y; |
813 |
// uint xi=(uint)blockIdx.x; |
|
814 |
// uint yi=(uint)blockIdx.y; |
|
815 |
// uint sizex=(uint)gridDim.x*blockDim.x; |
|
816 |
// uint sizey=(uint)gridDim.y*blockDim.y; |
|
817 | 816 |
|
818 | 817 |
// Perform trajectory for each pixel |
819 | 818 |
|
... | ... | |
904 | 903 |
// Integer Points on circle |
905 | 904 |
int imx=gridDim.y*blockDim.y; |
906 | 905 |
|
907 |
|
|
908 |
// Integer Impact Parameter ID |
|
909 |
// int bi=blockIdx.x; |
|
910 |
// Integer points on circle |
|
911 |
// int i=blockIdx.y; |
|
912 |
// Integer Impact Parameter Size (half of image) |
|
913 |
// int bmaxi=gridDim.x*blockDim.x; |
|
914 |
// Integer Points on circle |
|
915 |
// int imx=gridDim.y*blockDim.y; |
|
916 |
|
|
917 | 906 |
// Perform trajectory for each pixel |
918 | 907 |
|
919 | 908 |
float m,rs,ri,re,tho; |
... | ... | |
985 | 974 |
int Line) |
986 | 975 |
{ |
987 | 976 |
// Integer Impact Parameter ID |
988 |
// int bi=blockIdx.x; |
|
989 | 977 |
int bi=blockIdx.x*blockDim.x+threadIdx.x; |
990 | 978 |
// Integer Impact Parameter Size (half of image) |
991 | 979 |
int bmaxi=gridDim.x*blockDim.x; |
Formats disponibles : Unified diff