Final answer:
The true statements are that Numba uses LLVM to compile Python functions and that it can compile functions for the CPU. However, the njit decorator does not allow fallback to the Python interpreter, but raises an error instead if compilation fails.
Step-by-step explanation:
The student is asking about the capabilities of Numba, a just-in-time compiler for Python that uses LLVM to translate Python functions into machine code at runtime. To address the student's question, let's clarify the two true statements from the ones provided:
- c) Numba uses LLVM under the hood to compile Python functions. This is true. Numba utilizes LLVM which is a collection of modular and reusable compiler and toolchain technologies to compile Python code to machine code.
- e) The njit decorator can be used to allow fallback to the Python interpreter when Numba cannot compile. This statement is false. While the njit decorator is a shorthand for numba.jit with the argument nopython=True, which instructs Numba to compile the function with the restriction that Python objects and functions are not allowed. If Numba cannot compile the code under these conditions, it raises an error rather than falling back to the Python interpreter.
Statement a) is also true since Numba can indeed compile functions for both CPU and GPU; however, this isn't directly relevant to NVIDIA CUDA which is a parallel computing platform and API used for computing on GPUs. Statement b) is misleading as Numba doesn't compile functions down to C but rather directly to machine code using LLVM. Statement d) is incorrect, as the Python interpreter does not call Numba to compile all decorated functions in a prepass; rather, compilation occurs at runtime the first time the function is called.