real_remove_const (#7128)

This commit is contained in:
George Hotz 2024-10-17 21:58:41 +08:00 committed by GitHub
parent 2087abc999
commit c23ef7e2f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -113,8 +113,7 @@ class CStyleLanguage(Renderer):
if isinstance(dt, ImageDType):
return f"{'write_only' if mutable else 'read_only'} image2d_t"
if isinstance(dt, PtrDType):
return ("" if mutable else "const ") + (self.smem_prefix if dt.local else self.buffer_prefix) +\
self.render_dtype(dt.base) + ("*" if isinstance(dt, PtrDType) else "")
return (self.smem_prefix if dt.local else self.buffer_prefix) + self.render_dtype(dt.base) + ("*" if isinstance(dt, PtrDType) else "")
return self.type_map.get(scalar:=dt.scalar(), scalar.name) + (str(dt.count) if (dt.count) > 1 else "")
def __getitem__(self, key): return self.r[key] # hacky helper