UBC-ECE-Sasha / PIM-Embedding-Lookup

6 stars 5 forks source link

Use shift for MAX_SIZE #5

Open johnramsden opened 3 years ago

johnramsden commented 3 years ago

Perhaps it makes sense to use a shift so that it's clear that it's a power of two, and to increase it we just increase the shift by one.

Or maybe this should be a compile time variable?

https://github.com/UBC-ECE-Sasha/PIM-Embedding-Lookup/blob/1830cfbfb4fb21d810d3a6411575b717440c2a62/upmem/src/dpu/emb_dpu_lookup.c#L7

Potential fix

#define MAX_SIZE (1 << 7) // 128 - Must be a power of 2
nzarif commented 3 years ago

Isn't MEGABYTE(14) or MEGABYTE(1) and etc more readable? because in real case problems this MAX_SIZE is gonna be large.

johnramsden commented 3 years ago

Yeah, good option if it's going to be that large.