Révision 244 TrouNoir/TrouNoir.py
TrouNoir.py (revision 244) | ||
---|---|---|
1637 | 1637 |
|
1638 | 1638 |
kernel_params = {} |
1639 | 1639 |
|
1640 |
print(InputCL) |
|
1641 |
|
|
1642 | 1640 |
Device=InputCL['Device'] |
1643 | 1641 |
GpuStyle=InputCL['GpuStyle'] |
1644 | 1642 |
VariableType=InputCL['VariableType'] |
... | ... | |
1684 | 1682 |
queue = cl.CommandQueue(ctx, |
1685 | 1683 |
properties=cl.command_queue_properties.PROFILING_ENABLE) |
1686 | 1684 |
|
1687 |
|
|
1688 |
# BlackHoleCL = cl.Program(ctx,KERNEL_CODE.substitute(kernel_params)).build() |
|
1689 |
|
|
1690 | 1685 |
BuildOptions="-DPHYSICS=%i -DSETTRACKPOINTS=%i " % (PhysicsList[Physics],InputCL['TrackPoints']) |
1691 | 1686 |
|
1692 | 1687 |
print('My Platform is ',PF4XPU) |
... | ... | |
1696 | 1691 |
else: |
1697 | 1692 |
BuildOptions = BuildOptions+" -cl-mad-enable" |
1698 | 1693 |
|
1699 |
print(BuildOptions) |
|
1700 |
|
|
1701 | 1694 |
BlackHoleCL = cl.Program(ctx,BlobOpenCL).build(options = BuildOptions) |
1702 | 1695 |
|
1703 | 1696 |
# Je recupere les flag possibles pour les buffers |
... | ... | |
1732 | 1725 |
numpy.int32(Line)) |
1733 | 1726 |
CLLaunch.wait() |
1734 | 1727 |
elif Method=='EachCircle': |
1735 |
CLLaunch=BlackHoleCL.EachCircle(queue,(zImage.shape[0]/2,),
|
|
1728 |
CLLaunch=BlackHoleCL.EachCircle(queue,(int(zImage.shape[0]/2),),
|
|
1736 | 1729 |
None,zImageCL,fImageCL, |
1737 | 1730 |
numpy.float32(Mass), |
1738 | 1731 |
numpy.float32(InternalRadius), |
... | ... | |
1750 | 1743 |
numpy.int32(Line)) |
1751 | 1744 |
|
1752 | 1745 |
CLLaunch=BlackHoleCL.Circle(queue,(Trajectories.shape[0], |
1753 |
zImage.shape[0]*4),None,
|
|
1746 |
int(zImage.shape[0]*4)),None,
|
|
1754 | 1747 |
TrajectoriesCL,IdLastCL, |
1755 | 1748 |
zImageCL,fImageCL, |
1756 | 1749 |
numpy.float32(Mass), |
... | ... | |
1821 | 1814 |
|
1822 | 1815 |
kernel_params = {} |
1823 | 1816 |
|
1824 |
print(InputCL) |
|
1825 |
|
|
1826 | 1817 |
Device=InputCL['Device'] |
1827 | 1818 |
GpuStyle=InputCL['GpuStyle'] |
1828 | 1819 |
VariableType=InputCL['VariableType'] |
... | ... | |
2158 | 2149 |
except ImportError: |
2159 | 2150 |
print("Platform does not seem to support OpenCL") |
2160 | 2151 |
|
2161 |
# print(Devices,Alu) |
|
2162 | 2152 |
|
2163 |
# MyImage=numpy.where(numpy.random.zeros(Size,Size)>0,1,-1).astype(numpy.float32) |
|
2164 | 2153 |
zImage=numpy.zeros((Size,Size),dtype=numpy.float32) |
2165 | 2154 |
fImage=numpy.zeros((Size,Size),dtype=numpy.float32) |
2166 | 2155 |
|
Formats disponibles : Unified diff