mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
Refactor getenv into helpers (#508)
* Refactor getenv into helpers * Remove unused os * Fix default value * Fix more defaults for CI * Fix bracket * Revert changes to openpilot/compile.py * Use getenv from helpers when possible
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import unittest
|
||||
import numpy as np
|
||||
from tinygrad.ops import LazyOp, ReduceOps, BinaryOps, UnaryOps, MovementOps
|
||||
from tinygrad.shape import ShapeTracker, View, ZeroView
|
||||
from tinygrad.llops.ops_gpu import GPUBuffer, CLASTKernel
|
||||
from tinygrad.helpers import getenv
|
||||
from extra.lib_test_ast import test_ast
|
||||
|
||||
def compile_and_test_ast(ast):
|
||||
k = CLASTKernel(ast)
|
||||
if int(os.getenv("KOPT", "0")):
|
||||
if getenv("KOPT", 0):
|
||||
from extra.kernel_search import apply_optimization
|
||||
apply_optimization(k, ast, 10, int(os.getenv("KCACHE", "0")))
|
||||
apply_optimization(k, ast, 10, getenv("KCACHE", 0))
|
||||
k.codegen()(*k.bufs)
|
||||
if not int(os.getenv("NOTEST", "0")): test_ast(k)
|
||||
if not getenv("NOTEST", 0): test_ast(k)
|
||||
|
||||
class TestAST(unittest.TestCase):
|
||||
def test_conv_zeroview_ast(self):
|
||||
|
||||
Reference in New Issue
Block a user