Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Adding header guards to header files in include/runtime/cpu #448

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/hidet/runtime/callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once

#include <cstdint>
#include <hidet/runtime/common.h>

Expand Down
2 changes: 1 addition & 1 deletion include/hidet/runtime/cpu/bfloat16.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once
#include <cmath>
#include <cstring>
#include <stdint.h>
Expand Down
2 changes: 2 additions & 0 deletions include/hidet/runtime/cpu/complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once

#include <complex>

typedef std::complex<float> complex64_t;
Expand Down
2 changes: 2 additions & 0 deletions include/hidet/runtime/cpu/float16.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once

#include <cmath>
#include <cstring>
#include <stdint.h>
Expand Down
3 changes: 3 additions & 0 deletions include/hidet/runtime/cpu/float32.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include <math.h>

static inline float rsqrtf(float x)
Expand Down
2 changes: 1 addition & 1 deletion python/hidet/graph/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=redefined-builtin
from .matmul import batch_matmul, matmul, matmul_x86, matmul_cublas
from .matmul import batch_matmul, matmul, batch_matmul_x86, matmul_cublas
from .conv1d import conv1d, conv1d_gemm
from .conv1d_transpose import conv1d_transpose
from .conv2d import conv2d, conv2d_channel_last, conv2d_winograd, conv2d_gemm, conv2d_gemm_fp16
Expand Down
2 changes: 1 addition & 1 deletion python/hidet/graph/ops/matmul/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@


from .matmul_f32_x86 import Matmulx86Op, MatmulF32Taskx86
from .matmul_f32_x86 import matmul_x86
from .matmul_f32_x86 import batch_matmul_x86
4 changes: 2 additions & 2 deletions python/hidet/graph/ops/matmul/matmul_f32_x86.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def implement_cpu(self, working_dir: str) -> Union[IRModule, List[IRModule]]:
return tune.extract_ir_modules(self.schedule_matmulf32_x86)

@tune.space(1, MC=[2016], NC=[256, 384, 512], KC=[384, 512, 560], ways=[(1, 4, 2, 1)])
def schedule_matmulf32_x86(self, MC=2016, NC=384, KC=560, ways=(1, 4, 2, 1)) -> IRModule:
def schedule_matmulf32_x86(self, MC=2016, NC=384, KC=560, ways=(1, 1, 1, 1)) -> IRModule:
import hidet
from hidet.ir.type import tensor_type
from hidet.lang import tensor, grid, as_tensor_pointer
Expand Down Expand Up @@ -858,5 +858,5 @@ def __init__(self, a: Tensor, b: Tensor):
super().__init__(inputs=[a, b], attributes={}, task=task)


def matmul_x86(a: Tensor, b: Tensor) -> Tensor:
def batch_matmul_x86(a: Tensor, b: Tensor) -> Tensor:
return Matmulx86Op(a, b).outputs[0]
2 changes: 1 addition & 1 deletion tests/operators/test_matmul.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_matmul_x86(a_shape, b_shape):
a_shape,
b_shape,
lambda x, y: np.matmul(x, y),
lambda x, y: ops.matmul_x86(x, y) - ops.matmul_x86(x, y) + ops.matmul_x86(x, y),
lambda x, y: ops.batch_matmul_x86(x, y) - ops.batch_matmul_x86(x, y) + ops.batch_matmul_x86(x, y),
dtype="float32",
atol=1e-4,
rtol=1e-4,
Expand Down
Loading