Skip to content

Conversation

@Duyi-Wang
Copy link
Contributor

No description provided.

bool cache_matmul_primitive(dnnl::matmul::primitive_desc *matmul_pd, dnnl::matmul *matmul_prim, bool transA, int M,
int N, int K, int matmul_kind, const void *packedB = nullptr) {
// If M < primitiveCacheM or a power of 2, then cache.
if (M <= primitiveCacheM || !(M & 1)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To check if M is in power of 2: (M&(M−1))==0

@Duyi-Wang Duyi-Wang merged commit c81d7f2 into intel:main Jun 27, 2024
@Duyi-Wang Duyi-Wang deleted the prim_cache branch June 27, 2024 00:54
Duyi-Wang added a commit that referenced this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants