8from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9from AthenaConfiguration.ComponentFactory
import CompFactory
10from AthenaCommon.Logging
import logging
11from AthXRTServices.DeviceMgmtSvcConfig
import DeviceMgmtSvcCfg
12log = logging.getLogger(
"AthExXRT.XrtKernelExampleCfg")
16 result = ComponentAccumulator()
18 xclbin_list = [os.path.join(flags.FPGAMgmt.HLSDir,
'krnl_Combined.xclbin')]
19 result.merge(DeviceMgmtSvcCfg(flags,
22 OCLVectorAddEx = CompFactory.AthExXRT.VectorAddOCLExampleAlg()
23 result.addEventAlgo(OCLVectorAddEx)
25 OCLVectorMulEx = CompFactory.AthExXRT.VectorMultOCLExampleAlg()
26 result.addEventAlgo(OCLVectorMulEx)
32 result = ComponentAccumulator()
34 xclbin_list = [os.path.join(flags.FPGAMgmt.HLSDir,
'krnl_Combined.xclbin')]
35 result.merge(DeviceMgmtSvcCfg(flags,
38 XRTVectorAddEx = CompFactory.AthExXRT.VectorAddXRTExampleAlg()
39 result.addEventAlgo(XRTVectorAddEx)
41 XRTVectorMulEx = CompFactory.AthExXRT.VectorMultXRTExampleAlg()
42 result.addEventAlgo(XRTVectorMulEx)
48 result = ComponentAccumulator()
54if __name__ ==
"__main__":
55 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
56 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
57 flags = initConfigFlags()
58 flags.Exec.MaxEvents = 10
60 from AthXRTServices.FPGAConfigFlags
import createFPGAMgmtFlags
63 flags.addFlag(
"FPGAMgmt.doXRT",
True)
64 flags.addFlag(
"FPGAMgmt.doOCL",
True)
68 cfg = MainServicesCfg(flags)
69 if flags.FPGAMgmt.doXRT:
71 if flags.FPGAMgmt.doOCL:
75 sys.exit(cfg.run().isFailure())
OCLKernelExampleCfg(flags)
XrtKernelExampleCfg(flags)
MultiKernelExampleCfg(flags)