A method and an apparatus for performing stencil computation, and a compute device are provided. The method includes: obtaining a plurality of pieces of node data, and forming a data vector by using the plurality of pieces of node data; performing determining processing on the plurality of pieces of node data based on at least one computation condition included in the stencil computation, to obtain a determining result that is of each piece of node data and that corresponds to each computation condition; forming, for each computation condition, a determining result vector by using determining results that are of the plurality of pieces of node data and that correspond to the computation condition, to obtain the determining result vector; and performing, based on the data vector and the determining result vector, a computation operation corresponding to each computation condition, to obtain a computation result of the stencil computation.
Full Text
What is claimed is: