Skip to content

Commit

Permalink
[SYCL] Disable static_assert on device (tensorflow#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy authored and Luke Iwanski committed Feb 8, 2018
1 parent 814e88d commit d2e80bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tensorflow/core/common_runtime/executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ size_t GraphView::NodeItemBytes(const Node* n) {
+ num_inputs * sizeof(uint8) // input_type[num_inputs]
+ num_outputs * sizeof(uint8); // output_type[num_outputs]
static constexpr size_t kItemAlignment = sizeof(NodeItem*);
#if !(defined(TENSORFLOW_USE_SYCL) && defined(__SYCL_DEVICE_ONLY__))
static_assert(kItemAlignment % alignof(NodeItem) == 0,
"NodeItem must be aligned with kItemAlignment");
static_assert(kItemAlignment % alignof(EdgeInfo) == 0,
Expand All @@ -481,6 +482,7 @@ size_t GraphView::NodeItemBytes(const Node* n) {
"NodeItem must be aligned with AllocatorAttributes");
static_assert(sizeof(EdgeInfo) % alignof(AllocatorAttributes) == 0,
"EdgeInfo must be aligned with AllocatorAttributes");
#endif
const size_t bytes =
((raw_bytes + kItemAlignment - 1) / kItemAlignment) * kItemAlignment;
return bytes;
Expand Down

0 comments on commit d2e80bc

Please sign in to comment.