Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't include any allocation code for Mac #28

Open
JoeStrout opened this issue Sep 19, 2018 · 1 comment
Open

Doesn't include any allocation code for Mac #28

JoeStrout opened this issue Sep 19, 2018 · 1 comment

Comments

@JoeStrout
Copy link

I thought this was the Mac-savvy version of the code... but it's failing right out of the box for me on the first allocation (around line 350 of word2vec.c), because the conditional compilation doesn't include a Mac case:

#ifdef _MSC_VER
  syn0 = _aligned_malloc((long long)vocab_size * layer1_size * sizeof(real), 128);
#elif defined  linux
  a = posix_memalign((void **)&syn0, 128, (long long)vocab_size * layer1_size * sizeof(real));
#endif

Neither _MSC_VER nor linux is defined, so we simply don't allocate anything.

Just wondering if I have missed some obvious solution, or whether I need to add a Mac case (or maybe a generic case, simply using calloc?) to each such block.

@JoeStrout
Copy link
Author

Actually, as a test, just adding #define linux 1 to the top of the file seems to fix it (i.e., the posix functions seem to apply equally well to the Mac). But I'm still not certain that's the proper solution.

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

No branches or pull requests

1 participant