use f-string

This commit is contained in:
Jan Petykiewicz 2024-07-30 22:42:58 -07:00
parent 684557d479
commit 9282bfe8c0

View File

@ -61,17 +61,17 @@ ctype = type_to_C(numpy.complex128)
ctype_bare = 'cdouble'
# Preamble for all OpenCL code
preamble = '''
preamble = f'''
#define PYOPENCL_DEFINE_CDOUBLE
#include <pyopencl-complex.h>
//Defines to clean up operation and type names
#define ctype {ctype}_t
#define zero {ctype}_new(0.0, 0.0)
#define add {ctype}_add
#define sub {ctype}_sub
#define mul {ctype}_mul
'''.format(ctype=ctype_bare)
#define ctype {ctype_bare}_t
#define zero {ctype_bare}_new(0.0, 0.0)
#define add {ctype_bare}_add
#define sub {ctype_bare}_sub
#define mul {ctype_bare}_mul
'''
def ptrs(*args: str) -> list[str]: