Fixed a minor nullptr related issue in the code generator
parent
00687f8d81
commit
0c48c6e6c4
|
@ -61,8 +61,9 @@ def clblast_cc(routine, cuda=False):
|
||||||
if routine.batched:
|
if routine.batched:
|
||||||
result += " " + (NL + " ").join(routine.batched_transform_to_cpp()) + NL
|
result += " " + (NL + " ").join(routine.batched_transform_to_cpp()) + NL
|
||||||
if routine.temp_buffer:
|
if routine.temp_buffer:
|
||||||
result += " const auto temp_buffer_provided = temp_buffer != nullptr;\n"
|
null = "0" if cuda else "nullptr"
|
||||||
result += " auto temp_buffer_cpp = temp_buffer_provided ? Buffer<T>(temp_buffer) : Buffer<T>(nullptr);\n"
|
result += " const auto temp_buffer_provided = temp_buffer != " + null + ";\n"
|
||||||
|
result += " auto temp_buffer_cpp = temp_buffer_provided ? Buffer<T>(temp_buffer) : Buffer<T>(" + null + ");\n"
|
||||||
result += " routine.Do" + routine.capitalized_name() + "("
|
result += " routine.Do" + routine.capitalized_name() + "("
|
||||||
result += ("," + NL + indent1).join([a for a in routine.arguments_clcudaapi()])
|
result += ("," + NL + indent1).join([a for a in routine.arguments_clcudaapi()])
|
||||||
if routine.temp_buffer:
|
if routine.temp_buffer:
|
||||||
|
|
|
@ -822,7 +822,7 @@ class Routine:
|
||||||
if self.temp_buffer:
|
if self.temp_buffer:
|
||||||
result += ",\n" + indent + mem_type + " temp_buffer"
|
result += ",\n" + indent + mem_type + " temp_buffer"
|
||||||
if not implementation:
|
if not implementation:
|
||||||
result += " = nullptr"
|
result += " = 0" if cuda else " = nullptr"
|
||||||
result += ")"
|
result += ")"
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue