ray tracing need to consume amount of time,so i think whether the oneapi can be used to accelerate it.
Can you give more detail of you goal? Understanding your goal is needed to give appropriate guidance.
That being said, there are two OneAPI toolkits relevant for ray tracing in general.
The rendering toolkit contains a suite of rendering related libraries. In particular, Embree and OSPRay provide both a ray tracing primitives API and a render engine respectively. They are available in the toolkit itself as well as open source repositories. Sources for Embree and OSPRay are available on GitHub.
The toolkit serves as a platform to get started and try applications... for best performance on hardware, many users redeploy the Embree or OSPRay implementation specifics within their own applications. Many also rebuild Embree and OSPRay specifically for their targets and feature sets, then use them as an off the shelf/self contained library.
The base toolkit contains a compiler. Data Parallel C++… 'dpcpp' or 'DPC++'. Densely parallel or repeated operations can leverage command group handler functions like parallel_for (and it's functor/lamda) in search of acceleration on various device targets.
A developer could consider implementing a ray tracer with DPC++ offload regions. Performance will vary on the implementation and the device targets employed. However, currently (and fortunately), Intel has off the shelf ray tracing related implementations that aim to provide performance on Intel hardware.
For a user application its possible to mix and match a DPC++ application with the Rendering toolkit components. At this time, Embree or OSPRay API calls wouldn't reside in control group handler functors/lambdas... however, raw data out of such APIs could be passed to a DPC++ offload region for developer custom compute. The base toolkit is not a prerequisite for the rendering toolkit.