Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions cpp/gcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ else
endif
endif

# HG30112023
CUDA_PATH ?= /usr/local/cuda
CUDA_MATHLIBS_PATH ?= /usr/local/cuda
NVCC = $(CUDA_PATH)/bin/nvcc
NVCXX = $(CUDA_PATH)/bin/nvc++

SRW_SRC_DEF= -D_GNU_SOURCE -D__USE_XOPEN2K8 -DFFTW_ENABLE_FLOAT -D_GM_WITHOUT_BASE -DSRWLIB_STATIC -DNO_TIMER -DANSI_DECLARATORS -DTRILIBRARY $(OSFLAG)
SRW_INCLUDES= -I$(SRW_SRC_GEN_DIR) -I$(SRW_SRC_LIB_DIR) -I$(SH_SRC_PARSE_DIR) -I$(SH_SRC_GEN_MATH_DIR) $(SRW_SRC_DEF)
SRW_CFLAGS= -O3 -fPIC
Expand All @@ -35,6 +41,17 @@ LDFLAGS=-L$(LIB_DIR) -lm
ifeq ($(MODE), omp)
SRW_CFLAGS+= -D_WITH_OMP -fopenmp -Wno-write-strings
LDFLAGS+= -lfftw
else #HG30112023
ifeq ($(MODE), cuda)
CUDA_INCLUDES = -I$(CUDA_PATH)/include -I$(CUDA_MATHLIBS_PATH)/include
CUDA_LIBS = -L$(CUDA_PATH)/lib64 -L$(CUDA_MATHLIBS_PATH)/lib64

SRW_SRC_DEF += -D_OFFLOAD_GPU -DUSE_CUDA -D_FFTW3
SRW_INCLUDES += $(CUDA_INCLUDES)
SRW_CFLAGS += -std=c++17
LDFLAGS += $(CUDA_LIBS) -lcudart_static -lcudadevrt -lcufft -lrt
NVCFLAGS = -O3 -arch=sm_80 -dlto -rdc=true
CUDA_OBJ=gmfft_gpu.o srradstr_gpu.o sroptelm_gpu.o sroptdrf_gpu.o sroptgtr_gpu.o srradmnp_gpu.o
else
ifeq ($(MODE), 0)
SRW_CFLAGS+= -D_FFTW3
Expand All @@ -43,6 +60,7 @@ else
$(error Unknown SRW compilation option)
endif
endif
endif

PYFLAGS=-I$(shell python -c "from __future__ import print_function; from sysconfig import get_paths as gp; print(gp()['include'])")
PYFLAGS+=-L$(shell python -c "from __future__ import print_function; from sysconfig import get_paths as gp; import os; print(os.path.join(gp()['stdlib'], '../libs'))")
Expand Down Expand Up @@ -71,6 +89,10 @@ OBJ += timerec.o track.o srerror.o

# src/lib
OBJ += srwlib.o
# HG30112023
ifeq ($(MODE), cuda)
OBJ += auxgpu.o
endif

PRG= libsrw.a

Expand All @@ -89,6 +111,24 @@ PRG= libsrw.a
%.o: $(SRW_SRC_GENESIS_DIR)/%.c
$(CC) $(CFLAGS) -c $<

# HG30112023
ifeq ($(MODE), cuda)
lib: $(CUDA_OBJ) $(OBJ)
$(NVCC) $(NVCFLAGS) -Xcompiler="$(SRW_CFLAGS)" -dlink -o srwl_link.o *.o $(LDFLAGS)
ar -cvq $(PRG) *.o
#cp $(PRG) $(LIB_DIR)/
rm -f *.o

%.o: $(SRW_SRC_LIB_DIR)/%.cu
$(NVCC) -dc $(NVCFLAGS) $(SRW_INCLUDES) $(SRW_SRC_DEF) -Xcompiler="$(CFLAGS)" -c $<

%.o: $(SH_SRC_GEN_MATH_DIR)/%.cu
$(NVCC) -dc $(NVCFLAGS) $(SRW_INCLUDES) $(SRW_SRC_DEF) -Xcompiler="$(CFLAGS)" -c $<

%.o: $(SRW_SRC_GEN_DIR)/%.cu
$(NVCC) -dc $(NVCFLAGS) $(SRW_INCLUDES) $(SRW_SRC_DEF) -Xcompiler="$(CFLAGS)" -c $<

else
lib: $(OBJ)
ar -cvq $(PRG) *.o
#cp $(PRG) $(LIB_DIR)/
Expand All @@ -102,6 +142,7 @@ lib: $(OBJ)

%.o: $(SRW_SRC_GEN_DIR)/%.cu
$(NVCC) -x=c++ -Xcompiler="$(CFLAGS)" -c $<
endif

pylib:
$(CXX) -shared $(CFLAGS) $(PYFLAGS) -o srwlpy.so $(SRW_SRC_DIR)/clients/python/srwlpy.cpp libsrw.a $(LDFLAGS)
Expand Down
6 changes: 5 additions & 1 deletion cpp/py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

if 'MODE' in os.environ:
sMode = str(os.environ['MODE'])
if sMode == 'omp':
if sMode == 'cuda': # HG30112023
ext_kwargs.update({'libraries': ['srw', 'm', 'cudart_static', 'cudadevrt', 'cufft', 'fftw3f', 'fftw3', 'rt'], 'extra_compile_args': ['-O3', '-mavx2', '-fno-math-errno']})
ext_kwargs['library_dirs'].append('{0}/lib64'.format(os.environ['CUDA_PATH']))
ext_kwargs['library_dirs'].append('{0}/lib64'.format(os.environ['CUDA_MATHLIBS_PATH']))
elif sMode == 'omp':
#ext_kwargs.update({'extra_link_args': ['-fopenmp'],
ext_kwargs.update({'libraries': ['srw', 'm', 'fftw'], #OC07022019
'extra_link_args': ['-fopenmp'],
Expand Down
75 changes: 69 additions & 6 deletions cpp/src/clients/python/srwlpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include <map>
#include <sstream> //OCTEST_161214

#ifdef _OFFLOAD_GPU //HG30112023
#include "auxgpu.h"
#endif

//Added by S.Yakubov (for profiling?) at parallelizing SRW via OpenMP:
//#include <time.h>

Expand Down Expand Up @@ -3319,6 +3323,22 @@ void ParseSructSmpObj3D(double**& arObjShapeDefs, int& nObj3D, PyObject* oListSh
}
}

#ifdef _OFFLOAD_GPU //HG30112023
/************************************************************************//**
* Convert Python device specification to C++ structure.
***************************************************************************/
void ParseDeviceParam(PyObject* oDev, TGPUUsageArg* pGpu) //HG10202021 Convert Python device specification to C++ structure
{
if (oDev != 0) {
if (PyLong_Check(oDev)) {
pGpu->deviceIndex = _PyLong_AsInt(oDev);
return;
}
}
pGpu->deviceIndex = 0;
}
#endif

/************************************************************************//**
* Updates Py List by numbers
***************************************************************************/
Expand Down Expand Up @@ -4617,18 +4637,24 @@ static PyObject* srwlpy_CalcIntFromElecField(PyObject *self, PyObject *args)
{
//PyObject *oInt=0, *oWfr=0, *oPol=0, *oIntType=0, *oDepType=0, *oE=0, *oX=0, *oY=0;
//PyObject *oInt=0, *oWfr=0, *oPol=0, *oIntType=0, *oDepType=0, *oE=0, *oX=0, *oY=0, *oMeth=0;
PyObject *oInt=0, *oWfr=0, *oPol=0, *oIntType=0, *oDepType=0, *oE=0, *oX=0, *oY=0, *oMeth=0, *oFldTrj=0; //OC23022020
//PyObject *oInt=0, *oWfr=0, *oPol=0, *oIntType=0, *oDepType=0, *oE=0, *oX=0, *oY=0, *oMeth=0, *oFldTrj=0; //OC23022020
PyObject *oInt=0, *oWfr=0, *oPol=0, *oIntType=0, *oDepType=0, *oE=0, *oX=0, *oY=0, *oMeth=0, *oFldTrj=0, *oDev=0; //HG03012024
vector<Py_buffer> vBuf;
SRWLWfr wfr;
SRWLMagFldC *pMagCnt=0; //OC23022020
SRWLPrtTrj *pPrtTrj=0;

#ifdef _OFFLOAD_GPU //HG30112023
TGPUUsageArg gpu;
srwlUtiGPUProc(1); //to prepare GPU for calculations
#endif
try
{
//if(!PyArg_ParseTuple(args, "OOOOOOOO:CalcIntFromElecField", &oInt, &oWfr, &oPol, &oIntType, &oDepType, &oE, &oX, &oY)) throw strEr_BadArg_CalcIntFromElecField;
//if(!PyArg_ParseTuple(args, "OOOOOOOO|O:CalcIntFromElecField", &oInt, &oWfr, &oPol, &oIntType, &oDepType, &oE, &oX, &oY, &oMeth)) throw strEr_BadArg_CalcIntFromElecField; //OC13122019
//if(!PyArg_ParseTuple(args, "OOOOOOOO|O:CalcIntFromElecField", &oInt, &oWfr, &oPol, &oIntType, &oDepType, &oE, &oX, &oY, &oMeth, &oFldTrj)) throw strEr_BadArg_CalcIntFromElecField; //OC23022020
if(!PyArg_ParseTuple(args, "OOOOOOOO|OO:CalcIntFromElecField", &oInt, &oWfr, &oPol, &oIntType, &oDepType, &oE, &oX, &oY, &oMeth, &oFldTrj)) throw strEr_BadArg_CalcIntFromElecField; //OC03032021 (just formally corrected, according to number of arguments)
//if(!PyArg_ParseTuple(args, "OOOOOOOO|OO:CalcIntFromElecField", &oInt, &oWfr, &oPol, &oIntType, &oDepType, &oE, &oX, &oY, &oMeth, &oFldTrj)) throw strEr_BadArg_CalcIntFromElecField; //OC03032021 (just formally corrected, according to number of arguments)
if(!PyArg_ParseTuple(args, "OOOOOOOO|OOO:CalcIntFromElecField", &oInt, &oWfr, &oPol, &oIntType, &oDepType, &oE, &oX, &oY, &oMeth, &oFldTrj, &oDev)) throw strEr_BadArg_CalcIntFromElecField; //HG03012024
if((oInt == 0) || (oWfr == 0) || (oPol == 0) || (oIntType == 0) || (oDepType == 0) || (oE == 0) || (oX == 0) || (oY == 0)) throw strEr_BadArg_CalcIntFromElecField;

//char *arInt = (char*)GetPyArrayBuf(oInt, vBuf, PyBUF_WRITABLE, 0);
Expand Down Expand Up @@ -4691,7 +4717,13 @@ static PyObject* srwlpy_CalcIntFromElecField(PyObject *self, PyObject *args)

//ProcRes(srwlCalcIntFromElecField(arInt, &wfr, pol, intType, depType, e, x, y));
//ProcRes(srwlCalcIntFromElecField(arInt, &wfr, pol, intType, depType, e, x, y, pMeth)); //OC13122019

#ifdef _OFFLOAD_GPU //HG30112023
ParseDeviceParam(oDev, &gpu);
ProcRes(srwlCalcIntFromElecField(arInt, &wfr, pol, intType, depType, e, x, y, pMeth, pFldTrj, (void*)&gpu));
#else
ProcRes(srwlCalcIntFromElecField(arInt, &wfr, pol, intType, depType, e, x, y, pMeth, pFldTrj)); //OC23022020
#endif
}
catch(const char* erText)
{
Expand All @@ -4700,6 +4732,9 @@ static PyObject* srwlpy_CalcIntFromElecField(PyObject *self, PyObject *args)
oInt = 0;
}

#ifdef _OFFLOAD_GPU //HG30112023
srwlUtiGPUProc(0); //to free GPU
#endif
if(pMagCnt != 0) DeallocMagCntArrays(pMagCnt);
ReleasePyBuffers(vBuf);
EraseElementFromMap(&wfr, gmWfrPyPtr);
Expand Down Expand Up @@ -4932,7 +4967,8 @@ static PyObject* srwlpy_SetRepresElecField(PyObject *self, PyObject *args)
static PyObject* srwlpy_PropagElecField(PyObject *self, PyObject *args)
{
//PyObject *oWfr=0, *oOptCnt=0;
PyObject *oWfr=0, *oOptCnt=0, *oInt=0; //OC14082018
//PyObject *oWfr=0, *oOptCnt=0, *oInt=0; //OC14082018
PyObject *oWfr=0, *oOptCnt=0, *oInt=0, *oDev=0; //Hg03012024

vector<Py_buffer> vBuf;
SRWLWfr wfr;
Expand All @@ -4945,10 +4981,15 @@ static PyObject* srwlpy_PropagElecField(PyObject *self, PyObject *args)
//float **arInts=0;
char **arInts=0;

#ifdef _OFFLOAD_GPU //HG03012024
TGPUUsageArg gpu;
srwlUtiGPUProc(1); //to prepare GPU for calculations
#endif
try
{
//if(!PyArg_ParseTuple(args, "OO:PropagElecField", &oWfr, &oOptCnt)) throw strEr_BadArg_PropagElecField;
if(!PyArg_ParseTuple(args, "OO|O:PropagElecField", &oWfr, &oOptCnt, &oInt)) throw strEr_BadArg_PropagElecField; //OC14082018
//if(!PyArg_ParseTuple(args, "OO|O:PropagElecField", &oWfr, &oOptCnt, &oInt)) throw strEr_BadArg_PropagElecField; //OC14082018
if(!PyArg_ParseTuple(args, "OO|OO:PropagElecField", &oWfr, &oOptCnt, &oInt, &oDev)) throw strEr_BadArg_PropagElecField; //HG03012024
if((oWfr == 0) || (oOptCnt == 0)) throw strEr_BadArg_PropagElecField;

//Added by S.Yakubov (for profiling?) at parallelizing SRW via OpenMP:
Expand Down Expand Up @@ -4981,7 +5022,12 @@ static PyObject* srwlpy_PropagElecField(PyObject *self, PyObject *args)
}

//ProcRes(srwlPropagElecField(&wfr, &optCnt));
#ifdef _OFFLOAD_GPU //HG03012024
ParseDeviceParam(oDev, &gpu);
ProcRes(srwlPropagElecField(&wfr, &optCnt, nInt, arIntDescr, arIntMesh, arInts, (void*)&gpu));
#else
ProcRes(srwlPropagElecField(&wfr, &optCnt, nInt, arIntDescr, arIntMesh, arInts)); //OC15082018
#endif

//Added by S.Yakubov (for profiling?) at parallelizing SRW via OpenMP:
//srwlPrintTime(":srwlpy_PropagElecField :srwlPropagElecField", &start);
Expand All @@ -5002,6 +5048,9 @@ static PyObject* srwlpy_PropagElecField(PyObject *self, PyObject *args)
//PyErr_PrintEx(1);
oWfr = 0;
}
#ifdef _OFFLOAD_GPU //HG03012024
srwlUtiGPUProc(0); //to free GPU
#endif

DeallocOptCntArrays(&optCnt);
ReleasePyBuffers(vBuf);
Expand Down Expand Up @@ -5102,12 +5151,18 @@ static PyObject* srwlpy_CalcTransm(PyObject* self, PyObject* args) //HG27012021
***************************************************************************/
static PyObject* srwlpy_UtiFFT(PyObject *self, PyObject *args)
{
PyObject *oData=0, *oMesh=0, *oDir=0;
//PyObject *oData=0, *oMesh=0, *oDir=0;
PyObject *oData=0, *oMesh=0, *oDir=0, *oDev=0; //HG03012024
vector<Py_buffer> vBuf;

#ifdef _OFFLOAD_GPU //HG03012024
TGPUUsageArg gpu;
srwlUtiGPUProc(1); //to prepare GPU for calculations
#endif
try
{
if(!PyArg_ParseTuple(args, "OOO:UtiFFT", &oData, &oMesh, &oDir)) throw strEr_BadArg_UtiFFT;
//if(!PyArg_ParseTuple(args, "OOO:UtiFFT", &oData, &oMesh, &oDir)) throw strEr_BadArg_UtiFFT;
if(!PyArg_ParseTuple(args, "OOO|O:UtiFFT", &oData, &oMesh, &oDir, &oDev)) throw strEr_BadArg_UtiFFT; //HG03012024
if((oData == 0) || (oMesh == 0) || (oDir == 0)) throw strEr_BadArg_UtiFFT;

//int sizeVectBuf = (int)vBuf.size();
Expand Down Expand Up @@ -5143,7 +5198,12 @@ static PyObject* srwlpy_UtiFFT(PyObject *self, PyObject *args)
if(!PyNumber_Check(oDir)) throw strEr_BadArg_UtiFFT;
int dir = (int)PyLong_AsLong(oDir);

#ifdef _OFFLOAD_GPU //HG03012024
ParseDeviceParam(oDev, &gpu);
ProcRes(srwlUtiFFT(pcData, typeData, arMesh, nMesh, dir, (void*)&gpu));
#else
ProcRes(srwlUtiFFT(pcData, typeData, arMesh, nMesh, dir));
#endif

if(meshArType == 'l') UpdatePyListNum(oMesh, arMesh, nMesh); //04092016
}
Expand All @@ -5153,6 +5213,9 @@ static PyObject* srwlpy_UtiFFT(PyObject *self, PyObject *args)
//if(vBuf.size() > 0) ReleasePyBuffers(vBuf);
oData = 0; oMesh = 0; oDir = 0;
}
#ifdef _OFFLOAD_GPU //HG03012024
srwlUtiGPUProc(0); //to free GPU
#endif

ReleasePyBuffers(vBuf);

Expand Down
15 changes: 10 additions & 5 deletions cpp/src/core/sroptang.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class srTOptAngle : public srTGenOptElem {
AngY = InAngY;
}

int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, srTParPrecWfrPropag& ParPrecWfrPropag, srTRadResizeVect& ResBeforeAndAfterVect) //virtual
//int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, srTParPrecWfrPropag& ParPrecWfrPropag, srTRadResizeVect& ResBeforeAndAfterVect) //virtual
int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, srTParPrecWfrPropag& ParPrecWfrPropag, srTRadResizeVect& ResBeforeAndAfterVect, void* pvGPU=0) //virtual //HG30112023
{
//return PropagateRadiationMeth_0(pRadAccessData);
int res = 0;
Expand All @@ -43,11 +44,14 @@ class srTOptAngle : public srTGenOptElem {

//int PropagateRadiationSingleE_Meth_0(srTSRWRadStructAccessData* pRadAccessData, srTSRWRadStructAccessData* pPrevRadAccessData, void* pBuf=0) //OC06092019
//OC01102019 (restored)
int PropagateRadiationSingleE_Meth_0(srTSRWRadStructAccessData* pRadAccessData, srTSRWRadStructAccessData* pPrevRadAccessData)
//int PropagateRadiationSingleE_Meth_0(srTSRWRadStructAccessData* pRadAccessData, srTSRWRadStructAccessData* pPrevRadAccessData)
int PropagateRadiationSingleE_Meth_0(srTSRWRadStructAccessData* pRadAccessData, srTSRWRadStructAccessData* pPrevRadAccessData, void* pvGPU) //HG30112023
{
int result;
if(pRadAccessData->Pres != 0) if(result = SetRadRepres(pRadAccessData, 0)) return result;
if(result = TraverseRadZXE(pRadAccessData)) return result;
//if(pRadAccessData->Pres != 0) if(result = SetRadRepres(pRadAccessData, 0)) return result;
if(pRadAccessData->Pres != 0) if(result = SetRadRepres(pRadAccessData, 0, 0, 0, pvGPU)) return result; //HG30112023
//if(result = TraverseRadZXE(pRadAccessData)) return result;
if(result = TraverseRadZXE(pRadAccessData, 0, 0, pvGPU)) return result; //HG30112023
//consider programming Angle on angular side by simple change of limits
//however note potential problems for many photon energies!

Expand Down Expand Up @@ -131,7 +135,8 @@ class srTOptShift : public srTGenOptElem {
ShiftY = InShiftY;
}

int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, srTParPrecWfrPropag& ParPrecWfrPropag, srTRadResizeVect& ResBeforeAndAfterVect) //virtual
//int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, srTParPrecWfrPropag& ParPrecWfrPropag, srTRadResizeVect& ResBeforeAndAfterVect) //virtual
int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, srTParPrecWfrPropag& ParPrecWfrPropag, srTRadResizeVect& ResBeforeAndAfterVect, void* pvGPU=0) //virtual //HG04122023
{
//return PropagateRadiationMeth_0(pRadAccessData);
int res = 0;
Expand Down
24 changes: 16 additions & 8 deletions cpp/src/core/sroptapt.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ class srTAperture : public srTShapedOptElem {
srTAperture () {}

//int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, int MethNo, srTRadResizeVect& ResBeforeAndAfterVect)
int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, srTParPrecWfrPropag& ParPrecWfrPropag, srTRadResizeVect& ResBeforeAndAfterVect)
//int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, srTParPrecWfrPropag& ParPrecWfrPropag, srTRadResizeVect& ResBeforeAndAfterVect)
int PropagateRadiation(srTSRWRadStructAccessData* pRadAccessData, srTParPrecWfrPropag& ParPrecWfrPropag, srTRadResizeVect& ResBeforeAndAfterVect, void* pvGPU=0) //HG30112023
{
char &MethNo = ParPrecWfrPropag.MethNo;

if(MethNo == 0) return PropagateRadiationMeth_0(pRadAccessData);
//if(MethNo == 0) return PropagateRadiationMeth_0(pRadAccessData);
if(MethNo == 0) return PropagateRadiationMeth_0(pRadAccessData, pvGPU); //HG30112023
else if(MethNo == 1) return PropagateRadiationMeth_1(pRadAccessData);
//else if(MethNo == 2) return PropagateRadiationMeth_2(pRadAccessData, ResBeforeAndAfterVect);
else if(MethNo == 2) return PropagateRadiationMeth_2(pRadAccessData, ParPrecWfrPropag, ResBeforeAndAfterVect);
Expand All @@ -47,11 +49,14 @@ class srTAperture : public srTShapedOptElem {
//int PropagateRadiationMeth_0(srTSRWRadStructAccessData* pRadAccessData)
//int PropagateRadiationSingleE_Meth_0(srTSRWRadStructAccessData* pRadAccessData, srTSRWRadStructAccessData* pPrevRadAccessData, void* pBuf = 0) //OC06092019
//OC01102019 (restored)
int PropagateRadiationSingleE_Meth_0(srTSRWRadStructAccessData* pRadAccessData, srTSRWRadStructAccessData* pPrevRadAccessData)
//int PropagateRadiationSingleE_Meth_0(srTSRWRadStructAccessData* pRadAccessData, srTSRWRadStructAccessData* pPrevRadAccessData)
int PropagateRadiationSingleE_Meth_0(srTSRWRadStructAccessData* pRadAccessData, srTSRWRadStructAccessData* pPrevRadAccessData, void* pvGPU) //HG30112023
{
int result;
if(pRadAccessData->Pres != 0) if(result = SetRadRepres(pRadAccessData, 0)) return result;
if(result = TraverseRadZXE(pRadAccessData)) return result;
//if(pRadAccessData->Pres != 0) if(result = SetRadRepres(pRadAccessData, 0)) return result;
if(pRadAccessData->Pres != 0) if(result = SetRadRepres(pRadAccessData, 0, 0, 0, pvGPU)) return result; //HG30112023
//if(result = TraverseRadZXE(pRadAccessData)) return result;
if(result = TraverseRadZXE(pRadAccessData, 0, 0, pvGPU)) return result; //HG30112023
if(result = PropagateRadMoments(pRadAccessData, 0)) return result;

SetNewNonZeroWfrLimits(pRadAccessData);
Expand All @@ -76,11 +81,14 @@ class srTAperture : public srTShapedOptElem {

//int PropagateRadiationSimple(srTSRWRadStructAccessData* pRadAccessData, void* pBuf=0) //OC06092019
//OC01102019 (restored)
int PropagateRadiationSimple(srTSRWRadStructAccessData* pRadAccessData)
//int PropagateRadiationSimple(srTSRWRadStructAccessData* pRadAccessData)
int PropagateRadiationSimple(srTSRWRadStructAccessData* pRadAccessData, void* pvGPU=0) //HG30112023
{
int result;
if(pRadAccessData->Pres != 0) if(result = SetRadRepres(pRadAccessData, 0)) return result;
if(result = TraverseRadZXE(pRadAccessData)) return result;
//if(pRadAccessData->Pres != 0) if(result = SetRadRepres(pRadAccessData, 0)) return result;
if(pRadAccessData->Pres != 0) if(result = SetRadRepres(pRadAccessData, 0, 0, 0, pvGPU)) return result; //HG30112023
//if(result = TraverseRadZXE(pRadAccessData)) return result;
if(result = TraverseRadZXE(pRadAccessData, 0, 0, pvGPU)) return result; //HG30112023

SetNewNonZeroWfrLimits(pRadAccessData);
return 0;
Expand Down
Loading