예제 #1
0
파일: Tensor.py 프로젝트: xichuang/HiParTI
    def MTTKRP(self,
               mode,
               mats=None,
               matsorder=None,
               type="default",
               testing=False):
        if mats == None:
            serial = 0  # TODO make code to make mats inside here

        if type == "default":
            serial = 0  # TODO make params

        if type == "serial":
            PTI.ptiMTTKRP(self.address, mats.address, matsorder, mode)
        if type == "CPU":
            PTI.ptiOMPMTTKRP(self.address, mats.address, matsorder, mode)
        if type == "CPU_Reduce": PTI.ptiOmpMTTKRP_Reduce()
        if type == "CPU_Lock": PTI.ptiOmpMTTKRP_Lock()
        if type == "CUDA": PTI.ptiCudaMTTKRP()
        if type == "CUDA_1K": PTI.ptiCudaMTTKRPOneKernal()
        if type == "CUDA_SM": PTI.ptiCudaMTTKRPSM()
        if type == "CUDA_Device": PTI.ptiCudaMTTKRPDevice()
        if type == "CUDA_Coarse": PTI.ptiCudaCoareMTTKRP()
        if type == "Splitted": PTI.ptiSplittedMTTKRP()
        return mats
예제 #2
0
파일: Tensor.py 프로젝트: xichuang/HiParTI
    def MTTKRP(self,
               mode,
               mats=None,
               matsorder=None,
               type="default",
               testing=False):
        if mats == None:
            serial = 0  #TODO make code to make mats inside here

        if type == "default":
            print(
                "Default Cases not learned yet.  Make sure you spedify your run type."
            )

        if type == "serial":
            PTI.ptiMTTKRPHiCOO(self.address, mats.address, matsorder, mode)
        elif type == "CPU":
            PTI.ptiOMPMTTKRPHiCOO(self.address, mats.address, matsorder, mode)
        elif type == "CPU_Reduce":
            PTI.ptiOmpMTTKRP_Reduce()
        elif type == "CPU_Lock":
            PTI.ptiOmpMTTKRP_Lock()
        elif type == "CUDA":
            PTI.ptiCudaMTTKRP()
        elif type == "CUDA_1K":
            PTI.ptiCudaMTTKRPOneKernal()
        elif type == "CUDA_SM":
            PTI.ptiCudaMTTKRPSM()
        elif type == "CUDA_Device":
            PTI.ptiCudaMTTKRPDevice()
        elif type == "CUDA_Coarse":
            PTI.ptiCudaCoareMTTKRP()
        elif type == "Splitted":
            PTI.ptiSplittedMTTKRP()
        if not testing: return mats