# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

cudaroot=/usr/local/cuda

nvcc -gencode arch=compute_90,code=sm_90 -I${cudaroot}/include -L${cudaroot}/lib64 \
                 -I`pwd`/../../../third_party/cutlass/include/ \
                 -I`pwd`/../../../third_party/nlohmann_json/include/ \
                 -I`pwd`/ -I${cudaroot}/ -I`pwd`/ -I`pwd`/../../ \
                 -std=c++17 \
                 -c `pwd`/w4a8_moe_cutlass_kernel_template.cu -o w4a8_moe_gemm.o


nvcc -gencode arch=compute_90,code=sm_90 -I${cudaroot}/include -L${cudaroot}/lib64 \
                 -I`pwd`/../../../third_party/cutlass/include/ \
                 -std=c++17 \
                 -I`pwd`/../../../third_party/nlohmann_json/include/ \
                 -I/root/paddlejob/workspace/env_run/output/lizhenyun/ep/Paddle/ \
                 -I`pwd`/ -I${cudaroot}/ -I`pwd`/ -I`pwd`/../../ \
                 -c `pwd`/w4a8_moe_gemm_test.cu -o w4a8_moe_gemm_test.o

rm -rf w4a8_moe_gemm_test

nvcc  w4a8_moe_gemm_test.o w4a8_moe_gemm.o \
-L/usr/local/cuda/lib64/ -lnvToolsExt -o w4a8_moe_gemm_test -lcudart
