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

« back to all changes in this revision

Viewing changes to lib/gpu/lal_charmm_long.cpp

  • 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:
66
66
  // If atom type constants fit in shared memory use fast kernel
67
67
  int lj_types=ntypes;
68
68
  shared_types=false;
69
 
  if (this->_block_bio_size>=64 && mix_arithmetic)
 
69
  int max_bio_shared_types=this->device->max_bio_shared_types();
 
70
  if (this->_block_bio_size>=64 && mix_arithmetic &&
 
71
      lj_types<=max_bio_shared_types)
70
72
    shared_types=true;
71
73
  _lj_types=lj_types;
72
74
 
73
75
  // Allocate a host write buffer for data initialization
74
76
  int h_size=lj_types*lj_types;
75
 
  int max_bio_shared_types=this->device->max_bio_shared_types();
76
77
  if (h_size<max_bio_shared_types)
77
78
    h_size=max_bio_shared_types;
78
79
  UCL_H_Vec<numtyp> host_write(h_size*32,*(this->ucl_device),
84
85
  this->atom->type_pack4(ntypes,lj_types,lj1,host_write,host_lj1,host_lj2,
85
86
                         host_lj3,host_lj4);
86
87
 
87
 
  ljd.alloc(max_bio_shared_types,*(this->ucl_device),UCL_READ_ONLY);
88
 
  this->atom->self_pack2(ntypes,ljd,host_write,epsilon,sigma);
 
88
  if (shared_types) {
 
89
    ljd.alloc(max_bio_shared_types,*(this->ucl_device),UCL_READ_ONLY);
 
90
    this->atom->self_pack2(ntypes,ljd,host_write,epsilon,sigma);
 
91
  }
89
92
 
90
93
  sp_lj.alloc(8,*(this->ucl_device),UCL_READ_ONLY);
91
94
  for (int i=0; i<4; i++) {