#include <tgmath.h> in ops_clang (#3927)

* different clang sqrt/log2/exp2/sin function based on dtype

fixed softmax_argmax issue in #3552 for clang.

* tgmath.h

* revert those
This commit is contained in:
chenyu
2024-03-25 17:48:57 -04:00
committed by GitHub
parent 514c43201d
commit 4ecd5789ab
3 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ from tinygrad.helpers import cpu_time_execution
from tinygrad.codegen.kernel import LinearizerOptions
from tinygrad.renderer.cstyle import uops_to_cstyle, CStyleLanguage
CLANG_PROGRAM_HEADER = '#include <stdbool.h>\n#include <math.h>\n#define max(x,y) ((x>y)?x:y)\n#define half __fp16\n'
CLANG_PROGRAM_HEADER = '#include <stdbool.h>\n#include <tgmath.h>\n#define max(x,y) ((x>y)?x:y)\n#define half __fp16\n'
class ClangCompiler(Compiler):
linearizer_opts = LinearizerOptions("CLANG", supports_float4=False, has_local=False)