strip whitespace

This commit is contained in:
George Hotz
2023-11-25 14:09:06 -08:00
parent 9eb2746d62
commit c42d2c4731
3 changed files with 8 additions and 2 deletions

View File

@@ -1,6 +1,12 @@
repos: repos:
- repo: local - repo: local
hooks: hooks:
- id: whitespace
name: strip whitespace
entry: ./strip_whitespace.sh
language: system
always_run: true
pass_filenames: false
- id: mypy - id: mypy
name: mypy name: mypy
entry: mypy tinygrad/ extra/helpers.py entry: mypy tinygrad/ extra/helpers.py

View File

@@ -6,7 +6,7 @@ class CUDALanguage(CStyleLanguage):
smem_prefix = "__shared__ " smem_prefix = "__shared__ "
smem_prefix_for_cast = False smem_prefix_for_cast = False
arg_int_prefix = "const int" arg_int_prefix = "const int"
barrier = "__syncthreads();" barrier = "__syncthreads();"
float4 = "make_float4" float4 = "make_float4"
gid = [f'blockIdx.{chr(120+i)}' for i in range(3)] gid = [f'blockIdx.{chr(120+i)}' for i in range(3)]
lid = [f'threadIdx.{chr(120+i)}' for i in range(3)] lid = [f'threadIdx.{chr(120+i)}' for i in range(3)]

View File

@@ -19,7 +19,7 @@ class HIPLanguage(CStyleLanguage):
smem_prefix_for_cast=False smem_prefix_for_cast=False
barrier = "__syncthreads();" barrier = "__syncthreads();"
float4 = "make_float4" float4 = "make_float4"
uses_vload=True uses_vload=True
uses_ptr_arithmetic=True uses_ptr_arithmetic=True
arg_int_prefix = "const int" arg_int_prefix = "const int"
half_prekernel = "#include <hip/hip_fp16.h>\nusing half4 = HIP_vector_type<half, 4>;" + """ half_prekernel = "#include <hip/hip_fp16.h>\nusing half4 = HIP_vector_type<half, 4>;" + """