Chapter 13 List of Tips
Just noting down tips as I grasp them rather than code or details.
- Multiarchitecture Binary Fat Heavy Binary that supports multiple platforms.
- Compilation can be JIT or AOT. JIT preferred unless AOT is needed like fpga.
- JIT portable AOT fat basically. JIT Intermediate Representation like llvm mlir.
- Contexts represent device or devices on which code can run.
- Devices can have sub devices which behave exactly like devices.
- USM can be shared between devices in same context.
- Contexts are expensive to create. Less I make the better.
- Thread Safety, Introduce Parallelism, Fine tuning.
- Sycl can be used alongside openmp, tbb, mpi etc.
- Run debugging on CPU. Compile with debugging flags, compile with debug info.
- debugging deadlock -> move from out of order to in order queue, queue.wait().
- debugging kernel code -> break points before or after parallel for.
- kernels provide a c++ like out stream
- debugging runtime failures LOOK AT THE ERRORS.
- Don’t need to abort can catch or code around them. Use Dump Tools when all fails.
- Check aspect::queue_profiling to see if device supports queue_profiling.
- Enable profiling get profiling info etc.
- Tracing and Profiling tools one trace and oneprof.
- Don’t access host memory(array or vec)directly after creating a buffer from it.
- To avoid using host memory before buffer goes out of scope use host_accessors.
- Make sure host accessors are destroyed to return memory back and unlock use of kernel.
- while host accessor is alive runtime doesn’t allow buffer to be used by any device.
- To call functions in different translation unit use SYCL_EXTERNAL.
- only used on functions, no raw pointers only classes as param or return type.
- Can’t call parallel_for_work_item method. cannot be called from parallel_for_work_group.
- multiple translation unit can have performance implications so measure and tune.
- Lambdas can be named with
when multiple sycl tools are used.