Skip to content

In syncedmem.cpp, functions shall return a value#3321

Merged
shelhamer merged 1 commit intoBVLC:masterfrom
BonsaiAI:synced-mem-functions-will-return-a-value
Nov 16, 2015
Merged

In syncedmem.cpp, functions shall return a value#3321
shelhamer merged 1 commit intoBVLC:masterfrom
BonsaiAI:synced-mem-functions-will-return-a-value

Conversation

@eelstork
Copy link
Contributor

with CPU_ONLY builds gpu_data() and mutable_gpu_data() must return a value.

@shelhamer
Copy link
Member

NO_GPU triggers a fatal error so the return will never execute; see https://github.com/BVLC/caffe/blob/master/include/caffe/util/device_alternate.hpp#L10. Is this to make a compiler happy?

@eelstork
Copy link
Contributor Author

@shelhamer - Yes, this is to make a compiler happy. Actually I am somewhat surprised that a compiler would accept this at all.

@shelhamer
Copy link
Member

Alright, thanks for the compiler therapy!

shelhamer added a commit that referenced this pull request Nov 16, 2015
…rn-a-value

In syncedmem.cpp, functions shall return a value
@shelhamer shelhamer merged commit 603cbfb into BVLC:master Nov 16, 2015
@eelstork eelstork deleted the synced-mem-functions-will-return-a-value branch November 18, 2015 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments