Hi Freddie and everyone,
The more you learn, the more problems you encounter! Today, I want to discuss about a python operation in backend/openmp/base.py, which is very advanced. The code is shown as follow:
Instantiate mandatory kernel provider classes
kprovcls = [provider.OpenMPPointwiseKernelProvider,
blasext.OpenMPBlasExtKernels,
packing.OpenMPPackingKernels,
gimmik.OpenMPGiMMiKKernels]
self._providers = [k(self) for k in kprovcls]
The ‘self’ is brought into the class ‘k’. Using print function, I found that k(self) represents object and k denotes class. I am wondering what impact this will have?
print(provider.OpenMPPointwiseKernelProvider(self))
<pyfr.backends.openmp.provider.OpenMPPointwiseKernelProvider object at 0x7f5551a03b70>
print(provider.OpenMPPointwiseKernelProvider)
<class ‘pyfr.backends.openmp.provider.OpenMPPointwiseKernelProvider’>