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

Correct conversions errors from u64 to size_t(u32 on msvc32) #104

Merged
merged 2 commits into from
Dec 1, 2018

Conversation

DoumanAsh
Copy link
Contributor

There are still lots of warnings due to conversions between 32/64 bit integers, but I fixed only errors and these warnings around them.

Users should be able build it with msvc32 compiler

Closes #91

data_->memmgr.initialize(pageSize);
data_->alloc = data_->memmgr.value().core();
auto& alloc = data_->alloc;

const auto embedding_size = static_cast<size_t>(hdr.layerSize) * static_cast<size_t>(hdr.vocabSize);
const auto matrix_size = static_cast<size_t>(hdr.layerSize) * static_cast<size_t>(hdr.layerSize);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had second thought about whether hdr.layerSize * hdr.layerSize is mistake or not...

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a square matrix layerSize times layerSize, so that's correct

data_->memmgr.initialize(pageSize);
data_->alloc = data_->memmgr.value().core();
auto& alloc = data_->alloc;

const auto embedding_size = static_cast<size_t>(hdr.layerSize) * static_cast<size_t>(hdr.vocabSize);
Copy link
Contributor

@eiennohito eiennohito Dec 1, 2018

Choose a reason for hiding this comment

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

Could you name this embedding_matrix_size
Usually, a vector representation for a single token is called embedding.

Next thing should be called transition_matrix_size in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed it

Copy link
Contributor

Choose a reason for hiding this comment

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

transition_matrix_size as well please!

Anyway, congratulations on 1000th commit :p

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sorry, I thought you meant it as if we leave name as it is

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the confusion.

Need to improve my clearness.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed.

And thanks, sorry about ruining nice number 999 😄

@DoumanAsh
Copy link
Contributor Author

DoumanAsh commented Dec 1, 2018

Since build will be fixed by this commit, it would be nice if you could try to add msvc32 build to appveyor just to make sure it is not going to get broken in future

By default cmake choose x86 msbuild generator, unless you specify it, as far as my experience goes

@eiennohito eiennohito merged commit 6d517bd into ku-nlp:master Dec 1, 2018
@eiennohito
Copy link
Contributor

eiennohito commented Dec 1, 2018

https://ci.appveyor.com/project/eiennohito/jumanpp/builds/20694567/job/u883gac1of6chfnj

Some tests fail; I won't enable it by default.

@DoumanAsh
Copy link
Contributor Author

Oh, let me re-check it, I remember I had no troubles yesterday

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.

MSVC 2017 build fails with x86 architecture (v2.0.0-rc2)
2 participants