Révision 219
| TrouNoir/TrouNoir.py (revision 219) | ||
|---|---|---|
| 806 | 806 |
float ExternalRadius,float Angle, |
| 807 | 807 |
int Line) |
| 808 | 808 |
{
|
| 809 |
uint xi=(uint)blockIdx.x; |
|
| 810 |
uint yi=(uint)blockIdx.y; |
|
| 811 |
uint sizex=(uint)gridDim.x*blockDim.x; |
|
| 812 |
uint sizey=(uint)gridDim.y*blockDim.y; |
|
| 809 |
uint xi=(uint)(blockIdx.x*blockDim.x+threadIdx.x); |
|
| 810 |
uint yi=(uint)(blockIdx.y*blockDim.y+threadIdx.y); |
|
| 811 |
uint sizex=(uint)gridDim.x*blockDim.x; |
|
| 812 |
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; |
|
| 813 | 817 |
|
| 814 | 818 |
// Perform trajectory for each pixel |
| 815 | 819 |
|
| ... | ... | |
| 892 | 896 |
int Line) |
| 893 | 897 |
{
|
| 894 | 898 |
// Integer Impact Parameter ID |
| 895 |
int bi=blockIdx.x; |
|
| 899 |
int bi=blockIdx.x*blockDim.x+threadIdx.x;
|
|
| 896 | 900 |
// Integer points on circle |
| 897 |
int i=blockIdx.y; |
|
| 901 |
int i=blockIdx.y*blockDim.y+threadIdx.y;
|
|
| 898 | 902 |
// Integer Impact Parameter Size (half of image) |
| 899 | 903 |
int bmaxi=gridDim.x*blockDim.x; |
| 900 | 904 |
// Integer Points on circle |
| 901 | 905 |
int imx=gridDim.y*blockDim.y; |
| 902 | 906 |
|
| 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 |
|
|
| 903 | 917 |
// Perform trajectory for each pixel |
| 904 | 918 |
|
| 905 | 919 |
float m,rs,ri,re,tho; |
| ... | ... | |
| 971 | 985 |
int Line) |
| 972 | 986 |
{
|
| 973 | 987 |
// Integer Impact Parameter ID |
| 974 |
int bi=blockIdx.x; |
|
| 988 |
// int bi=blockIdx.x; |
|
| 989 |
int bi=blockIdx.x*blockDim.x+threadIdx.x; |
|
| 975 | 990 |
// Integer Impact Parameter Size (half of image) |
| 976 | 991 |
int bmaxi=gridDim.x*blockDim.x; |
| 977 | 992 |
|
| ... | ... | |
| 1182 | 1197 |
|
| 1183 | 1198 |
zMaxPosition=numpy.where(zImage[:,:]==zImage.max()) |
| 1184 | 1199 |
fMaxPosition=numpy.where(fImage[:,:]==fImage.max()) |
| 1185 |
print("Z max @(%i,%i) : %f" % (zMaxPosition[0][0],zMaxPosition[1][0],zImage.max()))
|
|
| 1186 |
print("Flux max @(%i,%i) : %f\n" % (fMaxPosition[0][0],fMaxPosition[1][0],fImage.max()))
|
|
| 1200 |
print("Z max @(%i,%i) : %f" % (zMaxPosition[1][0],zMaxPosition[0][0],zImage.max()))
|
|
| 1201 |
print("Flux max @(%i,%i) : %f\n" % (fMaxPosition[1][0],fMaxPosition[0][0],fImage.max()))
|
|
| 1187 | 1202 |
zImageCL.release() |
| 1188 | 1203 |
fImageCL.release() |
| 1189 | 1204 |
|
| ... | ... | |
| 1268 | 1283 |
numpy.float32(ExternalRadius), |
| 1269 | 1284 |
numpy.float32(Angle), |
| 1270 | 1285 |
numpy.int32(Line), |
| 1271 |
grid=(zImage.shape[0]/32,zImage.shape[1]/32),block=(32,32,1)) |
|
| 1286 |
grid=(zImage.shape[0]/32,zImage.shape[1]/32), |
|
| 1287 |
block=(32,32,1)) |
|
| 1272 | 1288 |
elif Method=='TrajectoCircle': |
| 1273 | 1289 |
TrajectoryCU(TrajectoriesCU,IdLastCU, |
| 1274 | 1290 |
numpy.uint32(Trajectories.shape[1]), |
| ... | ... | |
| 1277 | 1293 |
numpy.float32(ExternalRadius), |
| 1278 | 1294 |
numpy.float32(Angle), |
| 1279 | 1295 |
numpy.int32(Line), |
| 1280 |
grid=(Trajectories.shape[0],1),block=(1,1,1)) |
|
| 1296 |
grid=(Trajectories.shape[0]/32,1), |
|
| 1297 |
block=(32,1,1)) |
|
| 1281 | 1298 |
|
| 1282 | 1299 |
CircleCU(TrajectoriesCU,IdLastCU,zImageCU,fImageCU, |
| 1283 | 1300 |
numpy.uint32(Trajectories.shape[1]), |
| ... | ... | |
| 1286 | 1303 |
numpy.float32(ExternalRadius), |
| 1287 | 1304 |
numpy.float32(Angle), |
| 1288 | 1305 |
numpy.int32(Line), |
| 1289 |
grid=(Trajectories.shape[0],zImage.shape[0]*4),block=(1,1,1)) |
|
| 1306 |
grid=(Trajectories.shape[0]/32,zImage.shape[0]*4/32), |
|
| 1307 |
block=(32,32,1)) |
|
| 1290 | 1308 |
else: |
| 1291 | 1309 |
TrajectoryCU(TrajectoriesCU,IdLastCU, |
| 1292 | 1310 |
numpy.uint32(Trajectories.shape[1]), |
| ... | ... | |
| 1295 | 1313 |
numpy.float32(ExternalRadius), |
| 1296 | 1314 |
numpy.float32(Angle), |
| 1297 | 1315 |
numpy.int32(Line), |
| 1298 |
grid=(Trajectories.shape[0],1),block=(1,1,1)) |
|
| 1316 |
grid=(Trajectories.shape[0]/32,1), |
|
| 1317 |
block=(32,1,1)) |
|
| 1299 | 1318 |
|
| 1300 | 1319 |
PixelCU(zImageCU,fImageCU,TrajectoriesCU,IdLastCU, |
| 1301 | 1320 |
numpy.uint32(Trajectories.shape[0]), |
| ... | ... | |
| 1305 | 1324 |
numpy.float32(ExternalRadius), |
| 1306 | 1325 |
numpy.float32(Angle), |
| 1307 | 1326 |
numpy.int32(Line), |
| 1308 |
grid=(zImage.shape[0],zImage.shape[1],1),block=(1,1,1)) |
|
| 1327 |
grid=(zImage.shape[0]/32,zImage.shape[1]/32,1), |
|
| 1328 |
block=(32,32,1)) |
|
| 1309 | 1329 |
|
| 1310 | 1330 |
|
| 1311 | 1331 |
compute = time.time()-start_time |
| ... | ... | |
| 1318 | 1338 |
|
| 1319 | 1339 |
zMaxPosition=numpy.where(zImage[:,:]==zImage.max()) |
| 1320 | 1340 |
fMaxPosition=numpy.where(fImage[:,:]==fImage.max()) |
| 1321 |
print("Z max @(%i,%i) : %f" % (zMaxPosition[0][0],zMaxPosition[1][0],zImage.max()))
|
|
| 1322 |
print("Flux max @(%i,%i) : %f\n" % (fMaxPosition[0][0],fMaxPosition[1][0],fImage.max()))
|
|
| 1341 |
print("Z max @(%i,%i) : %f" % (zMaxPosition[1][0],zMaxPosition[0][0],zImage.max()))
|
|
| 1342 |
print("Flux max @(%i,%i) : %f\n" % (fMaxPosition[1][0],fMaxPosition[0][0],fImage.max()))
|
|
| 1323 | 1343 |
|
| 1324 | 1344 |
Context.pop() |
| 1325 | 1345 |
|
Formats disponibles : Unified diff