~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to lib/kokkos/core/src/impl/Kokkos_ViewSupport.hpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
//@HEADER
 
3
// ************************************************************************
 
4
//
 
5
//   Kokkos: Manycore Performance-Portable Multidimensional Arrays
 
6
//              Copyright (2012) Sandia Corporation
 
7
//
 
8
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
 
9
// the U.S. Government retains certain rights in this software.
 
10
//
 
11
// Redistribution and use in source and binary forms, with or without
 
12
// modification, are permitted provided that the following conditions are
 
13
// met:
 
14
//
 
15
// 1. Redistributions of source code must retain the above copyright
 
16
// notice, this list of conditions and the following disclaimer.
 
17
//
 
18
// 2. Redistributions in binary form must reproduce the above copyright
 
19
// notice, this list of conditions and the following disclaimer in the
 
20
// documentation and/or other materials provided with the distribution.
 
21
//
 
22
// 3. Neither the name of the Corporation nor the names of the
 
23
// contributors may be used to endorse or promote products derived from
 
24
// this software without specific prior written permission.
 
25
//
 
26
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
 
27
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
28
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
29
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
 
30
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
31
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
32
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 
33
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 
34
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 
35
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 
36
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
37
//
 
38
// Questions? Contact  H. Carter Edwards (hcedwar@sandia.gov)
 
39
//
 
40
// ************************************************************************
 
41
//@HEADER
 
42
*/
 
43
 
 
44
#ifndef KOKKOS_VIEWSUPPORT_HPP
 
45
#define KOKKOS_VIEWSUPPORT_HPP
 
46
 
 
47
#include <Kokkos_ExecPolicy.hpp>
 
48
#include <impl/Kokkos_Shape.hpp>
 
49
 
 
50
//----------------------------------------------------------------------------
 
51
//----------------------------------------------------------------------------
 
52
 
 
53
namespace Kokkos {
 
54
namespace Impl {
 
55
 
 
56
/** \brief  Evaluate if LHS = RHS view assignment is allowed. */
 
57
template< class ViewLHS , class ViewRHS >
 
58
struct ViewAssignable
 
59
{
 
60
  // Same memory space.
 
61
  // Same value type.
 
62
  // Compatible 'const' qualifier
 
63
  // Cannot assign managed = unmannaged
 
64
  enum { assignable_value =
 
65
    ( is_same< typename ViewLHS::value_type ,
 
66
               typename ViewRHS::value_type >::value
 
67
      ||
 
68
      is_same< typename ViewLHS::value_type ,
 
69
               typename ViewRHS::const_value_type >::value )
 
70
    &&
 
71
    is_same< typename ViewLHS::memory_space ,
 
72
             typename ViewRHS::memory_space >::value
 
73
    &&
 
74
    ( ! ( ViewLHS::is_managed && ! ViewRHS::is_managed ) )
 
75
  };
 
76
 
 
77
  enum { assignable_shape =
 
78
    // Compatible shape and matching layout:
 
79
    ( ShapeCompatible< typename ViewLHS::shape_type ,
 
80
                       typename ViewRHS::shape_type >::value
 
81
      &&
 
82
      is_same< typename ViewLHS::array_layout ,
 
83
               typename ViewRHS::array_layout >::value )
 
84
    ||
 
85
    // Matching layout, same rank, and LHS dynamic rank
 
86
    ( is_same< typename ViewLHS::array_layout ,
 
87
               typename ViewRHS::array_layout >::value
 
88
      &&
 
89
      int(ViewLHS::rank) == int(ViewRHS::rank)
 
90
      &&
 
91
      int(ViewLHS::rank) == int(ViewLHS::rank_dynamic) )
 
92
    ||
 
93
    // Both rank-0, any shape and layout
 
94
    ( int(ViewLHS::rank) == 0 && int(ViewRHS::rank) == 0 )
 
95
    ||
 
96
    // Both rank-1 and LHS is dynamic rank-1, any shape and layout
 
97
    ( int(ViewLHS::rank) == 1 && int(ViewRHS::rank) == 1 &&
 
98
      int(ViewLHS::rank_dynamic) == 1 )
 
99
    };
 
100
 
 
101
  enum { value = assignable_value && assignable_shape };
 
102
};
 
103
 
 
104
} // namespace Impl
 
105
} // namespace Kokkos
 
106
 
 
107
//----------------------------------------------------------------------------
 
108
//----------------------------------------------------------------------------
 
109
 
 
110
namespace Kokkos {
 
111
namespace Impl {
 
112
 
 
113
template< class ExecSpace , class Type , bool Initialize >
 
114
struct ViewDefaultConstruct
 
115
{ ViewDefaultConstruct( Type * , size_t ) {} };
 
116
 
 
117
 
 
118
/** \brief  ViewDataHandle provides the type of the 'data handle' which the view
 
119
 *          uses to access data with the [] operator. It also provides
 
120
 *          an allocate function and a function to extract a raw ptr from the
 
121
 *          data handle. ViewDataHandle also defines an enum ReferenceAble which
 
122
 *          specifies whether references/pointers to elements can be taken and a
 
123
 *          'return_type' which is what the view operators will give back.
 
124
 *          Specialisation of this object allows three things depending
 
125
 *          on ViewTraits and compiler options:
 
126
 *          (i)   Use special allocator (e.g. huge pages/small pages and pinned memory)
 
127
 *          (ii)  Use special data handle type (e.g. add Cuda Texture Object)
 
128
 *          (iii) Use special access intrinsics (e.g. texture fetch and non-caching loads)
 
129
 */
 
130
template< class StaticViewTraits , class Enable = void >
 
131
struct ViewDataHandle {
 
132
 
 
133
  enum { ReturnTypeIsReference = true };
 
134
 
 
135
  typedef typename StaticViewTraits::value_type * handle_type;
 
136
  typedef typename StaticViewTraits::value_type & return_type;
 
137
};
 
138
 
 
139
template< class StaticViewTraits , class Enable = void >
 
140
class ViewDataManagement : public ViewDataHandle< StaticViewTraits > {
 
141
private:
 
142
 
 
143
  template< class , class > friend class ViewDataManagement ;
 
144
 
 
145
  struct PotentiallyManaged  {};
 
146
  struct StaticallyUnmanaged {};
 
147
 
 
148
  /* Statically unmanaged if traits or not executing in host-accessible memory space */
 
149
  typedef typename
 
150
    Impl::if_c< StaticViewTraits::is_managed &&
 
151
                Impl::is_same< Kokkos::HostSpace
 
152
                             , Kokkos::Impl::ActiveExecutionMemorySpace >::value
 
153
              , PotentiallyManaged
 
154
              , StaticallyUnmanaged
 
155
              >::type StaticManagementTag ;
 
156
 
 
157
  enum { Unmanaged     = 0x01
 
158
       , Noncontiguous = 0x02
 
159
       };
 
160
 
 
161
  enum { DefaultTraits = Impl::is_same< StaticManagementTag , StaticallyUnmanaged >::value ? Unmanaged : 0 };
 
162
 
 
163
  unsigned m_traits ; ///< Runtime traits
 
164
 
 
165
 
 
166
  template< class T >
 
167
  inline static
 
168
  unsigned assign( const ViewDataManagement<T> & rhs , const PotentiallyManaged & )
 
169
    { return rhs.m_traits | ( rhs.is_managed() && Kokkos::HostSpace::in_parallel() ? unsigned(Unmanaged) : 0u ); }
 
170
 
 
171
  template< class T >
 
172
  KOKKOS_INLINE_FUNCTION static
 
173
  unsigned assign( const ViewDataManagement<T> & rhs , const StaticallyUnmanaged & )
 
174
    { return rhs.m_traits | Unmanaged ; }
 
175
 
 
176
  inline
 
177
  void increment( const void * ptr , const PotentiallyManaged & ) const
 
178
    { if ( is_managed() ) StaticViewTraits::memory_space::increment( ptr ); }
 
179
  
 
180
  inline
 
181
  void decrement( const void * ptr , const PotentiallyManaged & ) const
 
182
    { if ( is_managed() ) StaticViewTraits::memory_space::decrement( ptr ); }
 
183
  
 
184
  KOKKOS_INLINE_FUNCTION
 
185
  void increment( const void * , const StaticallyUnmanaged & ) const {}
 
186
  
 
187
  KOKKOS_INLINE_FUNCTION
 
188
  void decrement( const void * , const StaticallyUnmanaged & ) const {}
 
189
 
 
190
public:
 
191
 
 
192
  typedef typename ViewDataHandle< StaticViewTraits >::handle_type handle_type;
 
193
 
 
194
  KOKKOS_INLINE_FUNCTION
 
195
  ViewDataManagement() : m_traits( DefaultTraits ) {}
 
196
 
 
197
  KOKKOS_INLINE_FUNCTION
 
198
  ViewDataManagement( const ViewDataManagement & rhs )
 
199
    : m_traits( assign( rhs , StaticManagementTag() ) ) {}
 
200
 
 
201
  KOKKOS_INLINE_FUNCTION
 
202
  ViewDataManagement & operator = ( const ViewDataManagement & rhs )
 
203
    { m_traits = assign( rhs , StaticManagementTag() ); return *this ; }
 
204
 
 
205
  template< class SVT >
 
206
  KOKKOS_INLINE_FUNCTION
 
207
  ViewDataManagement( const ViewDataManagement<SVT> & rhs )
 
208
    : m_traits( assign( rhs , StaticManagementTag() ) ) {}
 
209
 
 
210
  template< class SVT >
 
211
  KOKKOS_INLINE_FUNCTION
 
212
  ViewDataManagement & operator = ( const ViewDataManagement<SVT> & rhs )
 
213
    { m_traits = assign( rhs , StaticManagementTag() ); return *this ; }
 
214
 
 
215
  KOKKOS_INLINE_FUNCTION
 
216
  bool is_managed() const { return ! ( m_traits & Unmanaged ); }
 
217
 
 
218
  KOKKOS_INLINE_FUNCTION
 
219
  bool is_contiguous() const { return ! ( m_traits & Noncontiguous ); }
 
220
 
 
221
  KOKKOS_INLINE_FUNCTION
 
222
  void set_unmanaged() { m_traits |= Unmanaged ; }
 
223
 
 
224
  KOKKOS_INLINE_FUNCTION
 
225
  void set_noncontiguous() { m_traits |= Noncontiguous ; }
 
226
 
 
227
 
 
228
  KOKKOS_INLINE_FUNCTION
 
229
  void increment( handle_type handle ) const
 
230
    { increment( ( typename StaticViewTraits::value_type *) handle , StaticManagementTag() ); }
 
231
 
 
232
  KOKKOS_INLINE_FUNCTION
 
233
  void decrement( handle_type handle ) const
 
234
    { decrement( ( typename StaticViewTraits::value_type *) handle , StaticManagementTag() ); }
 
235
 
 
236
 
 
237
  KOKKOS_INLINE_FUNCTION
 
238
  void increment( const void * ptr ) const
 
239
    { increment( ptr , StaticManagementTag() ); }
 
240
 
 
241
  KOKKOS_INLINE_FUNCTION
 
242
  void decrement( const void * ptr ) const
 
243
    { decrement( ptr , StaticManagementTag() ); }
 
244
 
 
245
 
 
246
  template< bool Initialize >
 
247
  static
 
248
  handle_type allocate( const std::string & label
 
249
                      , const Impl::ViewOffset< typename StaticViewTraits::shape_type
 
250
                                              , typename StaticViewTraits::array_layout > & offset_map )
 
251
    {
 
252
      typedef typename StaticViewTraits::execution_space  execution_space ;
 
253
      typedef typename StaticViewTraits::memory_space     memory_space ;
 
254
      typedef typename StaticViewTraits::value_type       value_type ;
 
255
 
 
256
      const size_t count = offset_map.capacity();
 
257
 
 
258
      value_type * ptr = (value_type*) memory_space::allocate( label , sizeof(value_type) * count );
 
259
 
 
260
        // Default construct within the view's execution space.
 
261
      (void) ViewDefaultConstruct< execution_space , value_type , Initialize >( ptr , count );
 
262
 
 
263
      return typename ViewDataHandle< StaticViewTraits >::handle_type(ptr);
 
264
    }
 
265
};
 
266
 
 
267
} // namespace Impl
 
268
} // namespace Kokkos
 
269
 
 
270
//----------------------------------------------------------------------------
 
271
//----------------------------------------------------------------------------
 
272
 
 
273
namespace Kokkos {
 
274
namespace Impl {
 
275
 
 
276
template< class OutputView , class InputView  , unsigned Rank = OutputView::Rank >
 
277
struct ViewRemap
 
278
{
 
279
  typedef typename OutputView::size_type   size_type ;
 
280
 
 
281
  const OutputView output ;
 
282
  const InputView  input ;
 
283
  const size_type n0 ;
 
284
  const size_type n1 ;
 
285
  const size_type n2 ;
 
286
  const size_type n3 ;
 
287
  const size_type n4 ;
 
288
  const size_type n5 ;
 
289
  const size_type n6 ;
 
290
  const size_type n7 ;
 
291
 
 
292
  ViewRemap( const OutputView & arg_out , const InputView & arg_in )
 
293
    : output( arg_out ), input( arg_in )
 
294
    , n0( std::min( (size_t)arg_out.dimension_0() , (size_t)arg_in.dimension_0() ) )
 
295
    , n1( std::min( (size_t)arg_out.dimension_1() , (size_t)arg_in.dimension_1() ) )
 
296
    , n2( std::min( (size_t)arg_out.dimension_2() , (size_t)arg_in.dimension_2() ) )
 
297
    , n3( std::min( (size_t)arg_out.dimension_3() , (size_t)arg_in.dimension_3() ) )
 
298
    , n4( std::min( (size_t)arg_out.dimension_4() , (size_t)arg_in.dimension_4() ) )
 
299
    , n5( std::min( (size_t)arg_out.dimension_5() , (size_t)arg_in.dimension_5() ) )
 
300
    , n6( std::min( (size_t)arg_out.dimension_6() , (size_t)arg_in.dimension_6() ) )
 
301
    , n7( std::min( (size_t)arg_out.dimension_7() , (size_t)arg_in.dimension_7() ) )
 
302
    {
 
303
      typedef typename OutputView::execution_space execution_space ;
 
304
      Kokkos::RangePolicy< execution_space > range( 0 , n0 );
 
305
      parallel_for( range , *this );
 
306
    }
 
307
 
 
308
  KOKKOS_INLINE_FUNCTION
 
309
  void operator()( const size_type i0 ) const
 
310
  {
 
311
    for ( size_type i1 = 0 ; i1 < n1 ; ++i1 ) {
 
312
    for ( size_type i2 = 0 ; i2 < n2 ; ++i2 ) {
 
313
    for ( size_type i3 = 0 ; i3 < n3 ; ++i3 ) {
 
314
    for ( size_type i4 = 0 ; i4 < n4 ; ++i4 ) {
 
315
    for ( size_type i5 = 0 ; i5 < n5 ; ++i5 ) {
 
316
    for ( size_type i6 = 0 ; i6 < n6 ; ++i6 ) {
 
317
    for ( size_type i7 = 0 ; i7 < n7 ; ++i7 ) {
 
318
      output.at(i0,i1,i2,i3,i4,i5,i6,i7) = input.at(i0,i1,i2,i3,i4,i5,i6,i7);
 
319
    }}}}}}}
 
320
  }
 
321
};
 
322
 
 
323
template< class OutputView , class InputView  >
 
324
struct ViewRemap< OutputView ,  InputView , 0 >
 
325
{
 
326
  typedef typename OutputView::value_type   value_type ;
 
327
  typedef typename OutputView::memory_space dst_space ;
 
328
  typedef typename InputView ::memory_space src_space ;
 
329
 
 
330
  ViewRemap( const OutputView & arg_out , const InputView & arg_in )
 
331
  {
 
332
    DeepCopy< dst_space , src_space >( arg_out.ptr_on_device() ,
 
333
                                       arg_in.ptr_on_device() ,
 
334
                                       sizeof(value_type) );
 
335
  }
 
336
};
 
337
 
 
338
//----------------------------------------------------------------------------
 
339
 
 
340
template< class ExecSpace , class Type >
 
341
struct ViewDefaultConstruct< ExecSpace , Type , true >
 
342
{
 
343
  Type * const m_ptr ;
 
344
 
 
345
  KOKKOS_INLINE_FUNCTION
 
346
  void operator()( const typename ExecSpace::size_type i ) const
 
347
    { new( m_ptr + i ) Type(); }
 
348
 
 
349
  ViewDefaultConstruct( Type * pointer , size_t capacity )
 
350
    : m_ptr( pointer )
 
351
    {
 
352
      Kokkos::RangePolicy< ExecSpace > range( 0 , capacity );
 
353
      parallel_for( range , *this );
 
354
      ExecSpace::fence();
 
355
    }
 
356
};
 
357
 
 
358
template< class OutputView , unsigned Rank = OutputView::Rank >
 
359
struct ViewFill
 
360
{
 
361
  typedef typename OutputView::const_value_type  const_value_type ;
 
362
  typedef typename OutputView::size_type         size_type ;
 
363
 
 
364
  const OutputView output ;
 
365
  const_value_type input ;
 
366
 
 
367
  ViewFill( const OutputView & arg_out , const_value_type & arg_in )
 
368
    : output( arg_out ), input( arg_in )
 
369
    {
 
370
      typedef typename OutputView::execution_space execution_space ;
 
371
      Kokkos::RangePolicy< execution_space > range( 0 , output.dimension_0() );
 
372
      parallel_for( range , *this );
 
373
      execution_space::fence();
 
374
    }
 
375
 
 
376
  KOKKOS_INLINE_FUNCTION
 
377
  void operator()( const size_type i0 ) const
 
378
  {
 
379
    for ( size_type i1 = 0 ; i1 < output.dimension_1() ; ++i1 ) {
 
380
    for ( size_type i2 = 0 ; i2 < output.dimension_2() ; ++i2 ) {
 
381
    for ( size_type i3 = 0 ; i3 < output.dimension_3() ; ++i3 ) {
 
382
    for ( size_type i4 = 0 ; i4 < output.dimension_4() ; ++i4 ) {
 
383
    for ( size_type i5 = 0 ; i5 < output.dimension_5() ; ++i5 ) {
 
384
    for ( size_type i6 = 0 ; i6 < output.dimension_6() ; ++i6 ) {
 
385
    for ( size_type i7 = 0 ; i7 < output.dimension_7() ; ++i7 ) {
 
386
      output.at(i0,i1,i2,i3,i4,i5,i6,i7) = input ;
 
387
    }}}}}}}
 
388
  }
 
389
};
 
390
 
 
391
template< class OutputView >
 
392
struct ViewFill< OutputView , 0 >
 
393
{
 
394
  typedef typename OutputView::const_value_type  const_value_type ;
 
395
  typedef typename OutputView::memory_space      dst_space ;
 
396
 
 
397
  ViewFill( const OutputView & arg_out , const_value_type & arg_in )
 
398
  {
 
399
    DeepCopy< dst_space , dst_space >( arg_out.ptr_on_device() , & arg_in ,
 
400
                                       sizeof(const_value_type) );
 
401
  }
 
402
};
 
403
 
 
404
} // namespace Impl
 
405
} // namespace Kokkos
 
406
 
 
407
//----------------------------------------------------------------------------
 
408
//----------------------------------------------------------------------------
 
409
 
 
410
namespace Kokkos {
 
411
 
 
412
struct ViewAllocateWithoutInitializing {
 
413
 
 
414
  const std::string label ;
 
415
 
 
416
  ViewAllocateWithoutInitializing() : label() {}
 
417
  ViewAllocateWithoutInitializing( const std::string & arg_label ) : label( arg_label ) {}
 
418
  ViewAllocateWithoutInitializing( const char * const  arg_label ) : label( arg_label ) {}
 
419
};
 
420
 
 
421
struct ViewAllocate {
 
422
 
 
423
  const std::string  label ;
 
424
 
 
425
  ViewAllocate() : label() {}
 
426
  ViewAllocate( const std::string & arg_label ) : label( arg_label ) {}
 
427
  ViewAllocate( const char * const  arg_label ) : label( arg_label ) {}
 
428
};
 
429
 
 
430
}
 
431
 
 
432
namespace Kokkos {
 
433
namespace Impl {
 
434
 
 
435
template< class Traits , class AllocationProperties , class Enable = void >
 
436
struct ViewAllocProp : public Kokkos::Impl::false_type {};
 
437
 
 
438
template< class Traits >
 
439
struct ViewAllocProp< Traits , Kokkos::ViewAllocate
 
440
  , typename Kokkos::Impl::enable_if<(
 
441
      Traits::is_managed && ! Kokkos::Impl::is_const< typename Traits::value_type >::value
 
442
    )>::type >
 
443
  : public Kokkos::Impl::true_type
 
444
{
 
445
  typedef size_t               size_type ;
 
446
  typedef const ViewAllocate & property_type ;
 
447
 
 
448
  enum { Initialize = true };
 
449
  enum { AllowPadding = false };
 
450
 
 
451
  inline
 
452
  static const std::string & label( property_type p ) { return p.label ; }
 
453
};
 
454
 
 
455
template< class Traits >
 
456
struct ViewAllocProp< Traits , std::string
 
457
  , typename Kokkos::Impl::enable_if<(
 
458
      Traits::is_managed && ! Kokkos::Impl::is_const< typename Traits::value_type >::value
 
459
    )>::type >
 
460
  : public Kokkos::Impl::true_type
 
461
{
 
462
  typedef size_t              size_type ;
 
463
  typedef const std::string & property_type ;
 
464
 
 
465
  enum { Initialize = true };
 
466
  enum { AllowPadding = false };
 
467
 
 
468
  inline
 
469
  static const std::string & label( property_type s ) { return s ; }
 
470
};
 
471
 
 
472
template< class Traits , unsigned N >
 
473
struct ViewAllocProp< Traits , char[N]
 
474
  , typename Kokkos::Impl::enable_if<(
 
475
      Traits::is_managed && ! Kokkos::Impl::is_const< typename Traits::value_type >::value
 
476
    )>::type >
 
477
  : public Kokkos::Impl::true_type
 
478
{
 
479
private:
 
480
  typedef char label_type[N] ;
 
481
public:
 
482
 
 
483
  typedef size_t             size_type ;
 
484
  typedef const label_type & property_type ;
 
485
 
 
486
  enum { Initialize = true };
 
487
  enum { AllowPadding = false };
 
488
 
 
489
  inline
 
490
  static std::string label( property_type s ) { return std::string(s) ; }
 
491
};
 
492
 
 
493
template< class Traits >
 
494
struct ViewAllocProp< Traits , Kokkos::ViewAllocateWithoutInitializing
 
495
  , typename Kokkos::Impl::enable_if<(
 
496
      Traits::is_managed && ! Kokkos::Impl::is_const< typename Traits::value_type >::value
 
497
    )>::type >
 
498
  : public Kokkos::Impl::true_type
 
499
{
 
500
  typedef size_t size_type ;
 
501
  typedef const Kokkos::ViewAllocateWithoutInitializing & property_type ;
 
502
 
 
503
  enum { Initialize = false };
 
504
  enum { AllowPadding = false };
 
505
 
 
506
  inline
 
507
  static std::string label( property_type s ) { return s.label ; }
 
508
};
 
509
 
 
510
} // namespace Impl
 
511
} // namespace Kokkos
 
512
 
 
513
//----------------------------------------------------------------------------
 
514
//----------------------------------------------------------------------------
 
515
 
 
516
namespace Kokkos {
 
517
namespace Impl {
 
518
 
 
519
template< class Traits , class PointerProperties , class Enable = void >
 
520
struct ViewRawPointerProp : public Kokkos::Impl::false_type {};
 
521
 
 
522
template< class Traits , typename T >
 
523
struct ViewRawPointerProp< Traits , T ,
 
524
  typename Kokkos::Impl::enable_if<(
 
525
    Impl::is_same< T , typename Traits::value_type >::value ||
 
526
    Impl::is_same< T , typename Traits::non_const_value_type >::value
 
527
  )>::type >
 
528
  : public Kokkos::Impl::true_type
 
529
{
 
530
  typedef size_t size_type ; 
 
531
};
 
532
 
 
533
} // namespace Impl
 
534
} // namespace Kokkos
 
535
 
 
536
//----------------------------------------------------------------------------
 
537
//----------------------------------------------------------------------------
 
538
 
 
539
#endif /* #ifndef KOKKOS_VIEWSUPPORT_HPP */
 
540
 
 
541