<commit_before>// Copyright (c) 2009-2019 The Regents of the University of Michigan
// This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.


// Maintainer: joaander

#include "CellList.h"
#include "Autotuner.h"

/*! \file CellListGPU.h
    \brief Declares the CellListGPU class
*/

#ifdef NVCC
#error This header cannot be compiled by nvcc
#endif

#include <hoomd/extern/pybind/include/pybind11/pybind11.h>

#ifndef __CELLLISTGPU_H__
#define __CELLLISTGPU_H__

//! Computes a cell list from the particles in the system on the GPU
/*! Calls GPU functions in CellListGPU.cuh and CellListGPU.cu
    \sa CellList
    \ingroup computes
*/
class PYBIND11_EXPORT CellListGPU : public CellList
    {
    public:
        //! Construct a cell list
        CellListGPU(std::shared_ptr<SystemDefinition> sysdef);

        virtual ~CellListGPU() { };

        //! Set autotuner parameters
        /*! \param enable Enable/disable autotuning
            \param period period (approximate) in time steps when returning occurs
        */
        virtual void setAutotunerParams(bool enable, unsigned int period)
            {
            CellList::setAutotunerParams(enable, period);
            m_tuner->setPeriod(period/10);
            m_tuner->setEnabled(enable);
            }

        //! Request a multi-GPU cell list
        virtual void setPerDevice(bool per_device)
            {
            if (! this->m_exec_conf->allConcurrentManagedAccess())
                throw std::runtime_error("Per-device cell list only supported with unified memory.");

            m_per_device = per_device;
            m_params_changed = true;
            }

        //! Return true if we maintain a cell list per device
        virtual bool getPerDevice() const
            {
            return m_per_device;
            }


        //! Get the cell list containing index (per device)
        virtual const GlobalArray<unsigned int>& getIndexArrayPerDevice() const
            {
            return m_idx_scratch;
            }

        //! Get the array of cell sizes (per device)
        virtual const GlobalArray<unsigned int>& getCellSizeArrayPerDevice() const
            {
            return m_cell_size_scratch;
            }<commit_msg>fix error condition<commit_after>// Copyright (c) 2009-2019 The Regents of the University of Michigan
// This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.


// Maintainer: joaander

#include "CellList.h"
#include "Autotuner.h"

/*! \file CellListGPU.h
    \brief Declares the CellListGPU class
*/

#ifdef NVCC
#error This header cannot be compiled by nvcc
#endif

#include <hoomd/extern/pybind/include/pybind11/pybind11.h>

#ifndef __CELLLISTGPU_H__
#define __CELLLISTGPU_H__

//! Computes a cell list from the particles in the system on the GPU
/*! Calls GPU functions in CellListGPU.cuh and CellListGPU.cu
    \sa CellList
    \ingroup computes
*/
class PYBIND11_EXPORT CellListGPU : public CellList
    {
    public:
        //! Construct a cell list
        CellListGPU(std::shared_ptr<SystemDefinition> sysdef);

        virtual ~CellListGPU() { };

        //! Set autotuner parameters
        /*! \param enable Enable/disable autotuning
            \param period period (approximate) in time steps when returning occurs
        */
        virtual void setAutotunerParams(bool enable, unsigned int period)
            {
            CellList::setAutotunerParams(enable, period);
            m_tuner->setPeriod(period/10);
            m_tuner->setEnabled(enable);
            }

        //! Request a multi-GPU cell list
        virtual void setPerDevice(bool per_device)
            {
            if (per_device && ! this->m_exec_conf->allConcurrentManagedAccess())
                throw std::runtime_error("Per-device cell list only supported with unified memory.");

            m_per_device = per_device;
            m_params_changed = true;
            }

        //! Return true if we maintain a cell list per device
        virtual bool getPerDevice() const
            {
            return m_per_device;
            }


        //! Get the cell list containing index (per device)
        virtual const GlobalArray<unsigned int>& getIndexArrayPerDevice() const
            {
            return m_idx_scratch;
            }

        //! Get the array of cell sizes (per device)
        virtual const GlobalArray<unsigned int>& getCellSizeArrayPerDevice() const
            {
            return m_cell_size_scratch;
            }
{'fraction_non_alphanumeric': 0.07862190812720848, 'fraction_numerical': 0.007508833922261484, 'mean_word_length': 2.2606191504679627, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '69752', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1224, 'n_words': 391}